Skip to content

Commit

Permalink
feat: add custom action to set PATH environment variable and show tha…
Browse files Browse the repository at this point in the history
…nk you message during installation
  • Loading branch information
simlarsen committed Dec 24, 2024
1 parent 70aae7c commit 5ca740b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
10 changes: 8 additions & 2 deletions InfrastructureAgent/windows/app-amd64-template.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
Source='binary_placeholder'
KeyPath='yes'
/>
<Environment Id='PATH' Name='PATH' Value='[INSTALLDIR]' Permanent='no' Part='last' Action='set' />
</Component>
</Directory>
</Directory>
Expand All @@ -57,12 +56,19 @@
<ComponentRef Id='MainExecutable' />
</Feature>


<CustomAction Id='SetEnvironment' Directory='TARGETDIR' ExeCommand='cmd.exe /c setx PATH [INSTALLDIR]' Return='check' />


<!-- Include the WixUIExtension for standard dialogs -->
<UIRef Id="WixUI_InstallDir" />
<!-- Add a custom action to show a thank you message -->
<CustomAction Id="ShowThankYou" Return="ignore" Execute="immediate" Script="vbscript"> <![CDATA[ MsgBox "Thank you for installing OneUptimevInfrastructure Agent!", vbInformation, "Installation Complete" ]]> </CustomAction>
<!-- Schedule the custom action to run at the end of the installation -->
<InstallExecuteSequence> <Custom Action="ShowThankYou" After="InstallFinalize">NOT Installed</Custom> </InstallExecuteSequence>
<InstallExecuteSequence>
<Custom Action="SetEnvironment" After="InstallFiles">NOT Installed</Custom>
<Custom Action="ShowThankYou" After="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>

</Product>
</Wix>
11 changes: 9 additions & 2 deletions InfrastructureAgent/windows/app-arm64-template.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
Source='binary_placeholder'
KeyPath='yes'
/>
<Environment Id='PATH' Name='PATH' Value='[INSTALLDIR]' Permanent='no' Part='last' Action='set' />

</Component>
</Directory>
</Directory>
Expand All @@ -57,12 +57,19 @@
<ComponentRef Id='MainExecutable' />
</Feature>


<CustomAction Id='SetEnvironment' Directory='TARGETDIR' ExeCommand='cmd.exe /c setx PATH [INSTALLDIR]' Return='check' />


<!-- Include the WixUIExtension for standard dialogs -->
<UIRef Id="WixUI_InstallDir" />
<!-- Add a custom action to show a thank you message -->
<CustomAction Id="ShowThankYou" Return="ignore" Execute="immediate" Script="vbscript"> <![CDATA[ MsgBox "Thank you for installing OneUptimevInfrastructure Agent!", vbInformation, "Installation Complete" ]]> </CustomAction>
<!-- Schedule the custom action to run at the end of the installation -->
<InstallExecuteSequence> <Custom Action="ShowThankYou" After="InstallFinalize">NOT Installed</Custom> </InstallExecuteSequence>
<InstallExecuteSequence>
<Custom Action="SetEnvironment" After="InstallFiles">NOT Installed</Custom>
<Custom Action="ShowThankYou" After="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>

</Product>
</Wix>

0 comments on commit 5ca740b

Please sign in to comment.