2015-10-21 05:03:22 +02:00
|
|
|
// main
|
|
|
|
var srDest;
|
|
|
|
var err;
|
|
|
|
var fDesktop;
|
|
|
|
var szFolderDesktop;
|
|
|
|
|
|
|
|
srDest = $SpaceRequired$;
|
2015-10-25 08:49:02 +01:00
|
|
|
err = initInstall("RetroZilla Installer", "/RetroZilla Installer", "$Version$");
|
2015-10-21 05:03:22 +02:00
|
|
|
logComment("initInstall: " + err);
|
|
|
|
|
|
|
|
// Find the current user's desktop
|
|
|
|
winreg = getWinRegistry();
|
|
|
|
winreg.setRootKey(winreg.HKEY_CURRENT_USER);
|
|
|
|
subkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
|
|
|
|
valname = "Desktop";
|
|
|
|
szFolderDesktop = winreg.getValueString(subkey, valname);
|
|
|
|
|
|
|
|
fDesktop = getFolder("file:///", szFolderDesktop);
|
|
|
|
logComment("Desktop location: " + fDesktop);
|
|
|
|
|
|
|
|
if(verifyDiskSpace(fDesktop, srDest))
|
|
|
|
{
|
|
|
|
setPackageFolder(fDesktop);
|
|
|
|
|
|
|
|
err = addFile("",
|
|
|
|
"",
|
2015-10-25 08:49:02 +01:00
|
|
|
"retroZ\zilla-win32-stub-installer.exe", // dir name in jar to extract
|
2015-10-21 05:03:22 +02:00
|
|
|
fDesktop, // Where to put this file (Returned from getFolder)
|
|
|
|
""); // subdir name to create relative to fProgram
|
|
|
|
|
|
|
|
logComment("addFile() returned: " + err);
|
|
|
|
|
2015-10-25 08:49:02 +01:00
|
|
|
err = execute("retrozilla-win32-stub-installer.exe", "", false);
|
2015-10-21 05:03:22 +02:00
|
|
|
logComment("execute() returned: " + err);
|
|
|
|
|
|
|
|
// check return value
|
|
|
|
if(err==SUCCESS)
|
|
|
|
{
|
|
|
|
err = performInstall();
|
|
|
|
logComment("performInstall() returned: " + err);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
cancelInstall(err);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
cancelInstall(INSUFFICIENT_DISK_SPACE);
|
|
|
|
|
|
|
|
// end main
|
|
|
|
|