/* Script used to start GIMP (known to work with Version 2.9.8) in portable * fashion. In this case portable means that all of the GIMP software is * located on a drive different from the Windows system drive, which is * usually the C: drive. * NOTE: To function correctly this script must be located in the same * folder as the top level folder for the GIMP software. In that, this script * uses whatever folder the script resides in as the root for portable GIMP. */ var gimpPath = "\\GIMP\\W64"; // Relative path to GIMP location (HOME) var gimpHome; // Assign this value to GIMP variable named HOME var gimpMain = "GIMP 2.9"; // Folder name of main GIMP distribution package var gimpCmd = "gimp-2.9.exe"; // File name of GIMP executable var usrData = "UserData"; // Name of sub-folder at gimpPath for user data var string; var WshShell = WScript.CreateObject("WScript.Shell"); // Obtain path to folder containing this script string = WScript.ScriptFullName.split("\\"+WScript.ScriptName)[0]; // Set path to GIMP distribution package gimpHome = string+gimpPath; // Set the Windows environment variable APPDATA string = gimpHome+"\\"+usrData+"\\AppData"; WshShell.Environment("PROCESS").Item("APPDATA") = string; string = WshShell.Environment("PROCESS").Item("APPDATA"); // Set the Windows environment variable LOCALAPPDATA string = gimpHome+"\\"+usrData+"\\LocalAppData"; WshShell.Environment("PROCESS").Item("LOCALAPPDATA") = string; string = WshShell.Environment("PROCESS").Item("LOCALAPPDATA"); var string = WScript.ScriptFullName.split(":")[0]; // Obtain drive letter //WScript.Echo('"Drive='+string+'"'); //WshShell.Environment("PROCESS").Item("HOME") = string+":\\"; WshShell.Environment("PROCESS").Item("HOME") = gimpHome; string = gimpHome+"\\"+usrData+"\\GIMP"; //WScript.echo("GIMP2_DIRECTORY="+string); WshShell.Environment("PROCESS").Item("GIMP2_DIRECTORY") = string; // Make the folder that contains the GIMP package the Current Directory WshShell.CurrentDirectory = gimpHome; command = ".\\"+gimpMain+"\\bin\\"+gimpCmd; //WScript.Echo('"'+command+'"'); WshShell.run('"'+command+'"');