diff --git a/Setup1/CustomAction_NoImpersonate.js b/Setup1/CustomAction_NoImpersonate.js deleted file mode 100644 index abc64d2..0000000 --- a/Setup1/CustomAction_NoImpersonate.js +++ /dev/null @@ -1,53 +0,0 @@ -// NoImpersonate.js -// Performs a post-build fixup of an msi to change all deferred custom actions to NoImpersonate - -// Constant values from Windows Installer -var msiOpenDatabaseModeTransact = 1; - -var msiViewModifyInsert = 1 -var msiViewModifyUpdate = 2 -var msiViewModifyAssign = 3 -var msiViewModifyReplace = 4 -var msiViewModifyDelete = 6 - -var msidbCustomActionTypeInScript = 0x00000400; -var msidbCustomActionTypeNoImpersonate = 0x00000800 - -if (WScript.Arguments.Length != 1) -{ - WScript.StdErr.WriteLine(WScript.ScriptName + " file"); - WScript.Quit(1); -} - -var filespec = WScript.Arguments(0); -var installer = WScript.CreateObject("WindowsInstaller.Installer"); -var database = installer.OpenDatabase(filespec, msiOpenDatabaseModeTransact); - -var sql -var view -var record - -try -{ - sql = "SELECT `Action`, `Type`, `Source`, `Target` FROM `CustomAction`"; - view = database.OpenView(sql); - view.Execute(); - record = view.Fetch(); - while (record) - { - if (record.IntegerData(2) & msidbCustomActionTypeInScript) - { - record.IntegerData(2) = record.IntegerData(2) | msidbCustomActionTypeNoImpersonate; - view.Modify(msiViewModifyReplace, record); - } - record = view.Fetch(); - } - - view.Close(); - database.Commit(); -} -catch(e) -{ - WScript.StdErr.WriteLine(e); - WScript.Quit(1); -} diff --git a/Setup1/Setup1.vdproj b/Setup1/Setup1.vdproj index cb3def1..fa5ae50 100644 --- a/Setup1/Setup1.vdproj +++ b/Setup1/Setup1.vdproj @@ -1984,7 +1984,7 @@ "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:TRUE" - "ProductVersion" = "8:6.0.902" + "ProductVersion" = "8:6.0.903" "Manufacturer" = "8:American Astronomical Society" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" @@ -2000,7 +2000,7 @@ "UseSystemSearchPath" = "11:TRUE" "TargetPlatform" = "3:1" "PreBuildEvent" = "8:" - "PostBuildEvent" = "8:cscript.exe \"$(ProjectDir)CustomAction_NoImpersonate.js\" \"$(BuiltOuputPath)\" \r\n" + "PostBuildEvent" = "8:cscript.exe \"$(ProjectDir)custom_actions.js\" \"$(BuiltOuputPath)\" \r\n" "RunPostBuildEvent" = "3:1" } "Registry" @@ -2255,7 +2255,7 @@ { "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_AA994987B73A45E0A37452BA0E40E0CE" { - "Name" = "8:WorldWide Telescope" + "Name" = "8:AAS WorldWide Telescope" "Condition" = "8:" "AlwaysCreate" = "11:FALSE" "DeleteAtUninstall" = "11:FALSE" @@ -2268,7 +2268,7 @@ "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_9325EF29FBD04D9BB5D8ECBF4590BFCB" { "Name" = "8:AutoUpdates" - "Condition" = "8:AUTOUPDATE==False" + "Condition" = "8:NOT(AUTOUPDATE) OR AUTOUPDATE=\"OFF\"" "Transitive" = "11:FALSE" "ValueTypes" = "3:3" "Value" = "3:0" @@ -2276,7 +2276,7 @@ "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_E2766E3501FE4A54B48DE352D72A09BE" { "Name" = "8:AutoUpdates" - "Condition" = "8:AUTOUPDATE" + "Condition" = "8:AUTOUPDATE AND AUTOUPDATE<>\"OFF\"" "Transitive" = "11:FALSE" "ValueTypes" = "3:3" "Value" = "3:1" @@ -2964,11 +2964,11 @@ "DisplayName" = "8:#1038" "Description" = "8:#1138" "Type" = "3:2" - "ContextData" = "8:Unchecked=;Checked=1" + "ContextData" = "8:Unchecked=;Checked=ON" "Attributes" = "3:0" "Setting" = "3:2" - "Value" = "8:1" - "DefaultValue" = "8:" + "Value" = "8:ON" + "DefaultValue" = "8:ON" "UsePlugInResources" = "11:TRUE" } "Checkbox1Visible" diff --git a/Setup1/custom_actions.js b/Setup1/custom_actions.js new file mode 100644 index 0000000..371bd51 --- /dev/null +++ b/Setup1/custom_actions.js @@ -0,0 +1,69 @@ +// custom_actions.js +// +// Performs post-build fixups of our MSI. + +// Constant values from Windows Installer: +var msiOpenDatabaseModeTransact = 1; + +var msiViewModifyInsert = 1; +var msiViewModifyUpdate = 2; +var msiViewModifyAssign = 3; +var msiViewModifyReplace = 4; +var msiViewModifyDelete = 6; + +var msidbCustomActionTypeInScript = 0x00000400; +var msidbCustomActionTypeNoImpersonate = 0x00000800; + +if (WScript.Arguments.Length != 1) { + WScript.StdErr.WriteLine(WScript.ScriptName + " file"); + WScript.Quit(1); +} + +var filespec = WScript.Arguments(0); +var installer = WScript.CreateObject("WindowsInstaller.Installer"); +var database = installer.OpenDatabase(filespec, msiOpenDatabaseModeTransact); + +function MakeActionsNoImpersonate() { + var sql = "SELECT `Action`, `Type`, `Source`, `Target` FROM `CustomAction`"; + var view = database.OpenView(sql); + view.Execute(); + + var record = view.Fetch(); + + while (record) { + if (record.IntegerData(2) & msidbCustomActionTypeInScript) { + record.IntegerData(2) = record.IntegerData(2) | msidbCustomActionTypeNoImpersonate; + view.Modify(msiViewModifyReplace, record); + } + + record = view.Fetch(); + } + + view.Close(); +} + +function SetConditionOfAction(action, table, condition) { + var sql = "SELECT `Action`, `Condition`, `Sequence` FROM " + table + " WHERE `Action`='" + action + "'"; + var view = database.OpenView(sql); + view.Execute(); + + var record = view.Fetch(); + + record.StringData(2) = condition; + view.Modify(msiViewModifyReplace, record); + view.Close(); +} + +try { + // Change all deferred custom actions to NoImpersonate: + MakeActionsNoImpersonate(); + + // Don't override AUTOUPDATE if it was specified on the command line: + SetConditionOfAction("CustomCheckA_SetProperty_CHECKBOX1", "InstallExecuteSequence", "NOT(AUTOUPDATE)"); + SetConditionOfAction("CustomCheckA_SetProperty_CHECKBOX1", "InstallUISequence", "NOT(AUTOUPDATE)"); + + database.Commit(); +} catch (e) { + WScript.StdErr.WriteLine(e); + WScript.Quit(1); +} diff --git a/WWTExplorer3d/3dWindow.cs b/WWTExplorer3d/3dWindow.cs index 2f7a187..2cf9e68 100644 --- a/WWTExplorer3d/3dWindow.cs +++ b/WWTExplorer3d/3dWindow.cs @@ -5729,7 +5729,7 @@ static private bool ShouldAutoUpdate() { RegistryKey root = Registry.CurrentUser; - RegistryKey wwtKey = root.OpenSubKey("Software\\American Astronomical Society\\WorldWide Telescope"); + RegistryKey wwtKey = root.OpenSubKey("Software\\American Astronomical Society\\AAS WorldWide Telescope"); if (wwtKey == null) { return true; @@ -7813,16 +7813,13 @@ private static bool CheckForUpdates(bool interactive) if (RenderEngine.multiMonClient) { - System.Diagnostics.Process.Start(@"msiexec.exe", string.Format(@"/i {0}\wwtsetup.msi /q", Path.GetTempPath())); + System.Diagnostics.Process.Start(@"msiexec.exe", string.Format(@"/fvomus {0}\wwtsetup.msi /q", Path.GetTempPath())); } else { - System.Diagnostics.Process.Start(@"msiexec.exe", string.Format(@"/i {0}\wwtsetup.msi", Path.GetTempPath())); + System.Diagnostics.Process.Start(@"msiexec.exe", string.Format(@"/fvomus {0}\wwtsetup.msi", Path.GetTempPath())); } - - - return false; } else @@ -7852,11 +7849,11 @@ private static bool CheckForUpdates(bool interactive) if (RenderEngine.multiMonClient) { - System.Diagnostics.Process.Start(@"msiexec.exe", string.Format(@"/i {0}\wwtsetup.msi /q", Path.GetTempPath())); + System.Diagnostics.Process.Start(@"msiexec.exe", string.Format(@"/fvomus {0}\wwtsetup.msi /q", Path.GetTempPath())); } else { - System.Diagnostics.Process.Start(@"msiexec.exe", string.Format(@"/i {0}\wwtsetup.msi", Path.GetTempPath())); + System.Diagnostics.Process.Start(@"msiexec.exe", string.Format(@"/fvomus {0}\wwtsetup.msi", Path.GetTempPath())); } return false; diff --git a/WWTExplorer3d/CHANGELOG.md b/WWTExplorer3d/CHANGELOG.md index a9b3bf6..8754f55 100644 --- a/WWTExplorer3d/CHANGELOG.md +++ b/WWTExplorer3d/CHANGELOG.md @@ -1,3 +1,17 @@ +# WWTExplorer 6.0.903.0 (2022-01-05) + +- Attempt to fix the auto-updating functionality with current installers (#194, + @pkgw). The old method of launching `msiexec /i` doesn't seem to work anymore, + resulting in an error with a refusal to reinstall an already-installed + application. We'll put out an additional release so that we can exercise the + changed behavior (which now uses `msiexec /fvomus`). +- Make it so that the auto-update setting can be controlled from the command + line, using `msiexec ... AUTOUPDATE=OFF` to disable auto-updates (#133, #194, + @pkgw). This should be helpful for scripted installations. (All settings + besides `OFF` should result in the default behavior of auto-updating being + enabled.) + + # WWTExplorer 6.0.902.0 (2022-01-04) This release contains only non-functionality updates as we test the continuous diff --git a/WWTExplorer3d/Properties/AssemblyInfo.cs b/WWTExplorer3d/Properties/AssemblyInfo.cs index 80e348d..5390184 100644 --- a/WWTExplorer3d/Properties/AssemblyInfo.cs +++ b/WWTExplorer3d/Properties/AssemblyInfo.cs @@ -30,8 +30,8 @@ // Build Number // Revision // -[assembly: AssemblyVersion("6.0.902.0")] -[assembly: AssemblyFileVersion("6.0.902.0")] +[assembly: AssemblyVersion("6.0.903.0")] +[assembly: AssemblyFileVersion("6.0.903.0")] [assembly: NeutralResourcesLanguageAttribute("en-US")] [assembly: System.Windows.Media.DisableDpiAwareness]