Fix bug causing PloverPackageSet to treat '' and 'file:/' as distinct root URIs
1 var WshShell = WScript.CreateObject("WScript.Shell");
2 var ScriptPath = WScript.ScriptFullName.replace(/\\[^\\]*$/, "");
3 var FileSystemObject = new ActiveXObject("Scripting.FileSystemObject");
5 function RunUpdate(args)
7 var OKButton = 0, ErrorIcon = 16, ForReading = 1;
8 var path, command, i, ExecObject, text;
9 path = FileSystemObject.BuildPath(ScriptPath, "update.exe");
10 command = "\"" + path + "\"";
11 for(i = 0; i < args.Length; i++)
12 command += " \"" + args.Item(i) + "\"";
13 ExecObject = WshShell.Exec(command);
14 if (!ExecObject.StdErr.AtEndOfStream)
16 text = "Update failed for an unexpected reason. Please report "
17 + "the following error to support@city-occupational.co.uk:\n\n"
18 + ExecObject.StdErr.ReadAll();
19 WshShell.Popup(text, 0, "Update failed", OKButton + ErrorIcon);
22 else if (ExecObject.ExitCode)
24 text = "Update failed without giving a reason. Please report "
25 + "this to support@city-occupational.co.uk";
26 WshShell.Popup(text, 0, "Update failed", OKButton + ErrorIcon);
35 path = FileSystemObject.BuildPath(ScriptPath, "pre-inst.exe");
36 WshShell.Run("\"" + path + "\"" + " --post \"wscript.exe"
37 + " \\\"" + WScript.ScriptFullName + "\\\""
38 + " --post %INSTALL_PREFIX% %TEST_RESULT%\"",
44 var OKButton = 0, InfoIcon = 64, text;
45 var test_result, install_prefix, path, args;
46 install_prefix = WScript.Arguments.Item(1);
47 test_result = WScript.Arguments.Item(2);
48 if (test_result == "pass")
50 path = FileSystemObject.BuildPath(install_prefix,
51 "bin\\app-manager.exe");
52 WshShell.Run("\"" + path + "\" --update \"" + ScriptPath + "\"");
56 args = { Length:0, Item:function(){return nil} };
59 text = "Software update completed successfully.";
60 WshShell.Popup(text, 0, "Software Update", OKButton + InfoIcon);
65 if (WScript.Arguments.Length < 1)
67 else if (WScript.Arguments.Length >= 3 && WScript.Arguments.Item(0) == "--post")