Skip to content

Commit

Permalink
VPN-6448 try to scheudle a reboot on w10 (2.24 only) (#9809)
Browse files Browse the repository at this point in the history
* try to scheudle a reboot on w10

* DUH windows versions are not making sense anymore

* Add proper reboot checks
  • Loading branch information
strseb authored Sep 2, 2024
1 parent f41e83b commit 1d2cd66
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions windows/installer/MozillaVPN.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@
<Property Id="DISABLEROLLBACK" Value="yes" />
<Property Id="MSIDISABLERMRESTART" Value="1" />
<Property Id="MSIRMSHUTDOWN" Value="1" />

<Property Id="WINDOWS_BUILD_NUMBER">
<!-- Search for the Windows build number in the registry, given wix NT_VERSION
is unchanged between w10 and w11 ~_~
-->
<RegistrySearch Id="SearchWindowsBuildNumber"
Root="HKLM"
Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion"
Name="CurrentBuild"
Type="raw"
/>
</Property>

<!--
Upgrading
Expand Down Expand Up @@ -167,8 +179,17 @@
<CustomAction Id="LaunchVPNFirstExecution" Impersonate="yes" FileKey="MozillaVPNExecutable" ExeCommand="" Return="asyncNoWait" />
<CustomAction Id="LaunchVPNAfterUpdate" Impersonate="yes" FileKey="MozillaVPNExecutable" ExeCommand="ui --updated" Return="asyncNoWait" />
<InstallExecuteSequence>
<Custom Action="LaunchVPNFirstExecution" After="InstallFinalize">NOT WIX_UPGRADE_DETECTED</Custom>
<Custom Action="LaunchVPNAfterUpdate" After="InstallFinalize">WIX_UPGRADE_DETECTED</Custom>
<!-- This will schedule a reboot only if the OS is Windows 10 -->
<ScheduleReboot After="InstallFinalize">
<![CDATA[WINDOWS_BUILD_NUMBER < 22000]]>
</ScheduleReboot>
<Custom Action="LaunchVPNFirstExecution" After="InstallFinalize">
<![CDATA[NOT WIX_UPGRADE_DETECTED AND (WINDOWS_BUILD_NUMBER >= 22000 )]]>
</Custom>
<Custom Action="LaunchVPNAfterUpdate" After="InstallFinalize">
<![CDATA[WIX_UPGRADE_DETECTED AND (WINDOWS_BUILD_NUMBER >= 22000)]]>

</Custom>
</InstallExecuteSequence>

<!--
Expand Down

0 comments on commit 1d2cd66

Please sign in to comment.