Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/gsudo.Installer/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

<InstallExecuteSequence>
<!-- https://stackoverflow.com/a/17608049/97471 -->
<Custom Action="CreateSudoCurrentFolderLink" Before="InstallFinalize" Condition="NOT Installed" />
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have to create the Current junction directory before we create the sudo.exe symlink.

<Custom Action="CreateSudoExeLink" Before="InstallFinalize" Condition="NOT Installed" />
<Custom Action="RemoveSudoExeLink" After="InstallInitialize" Condition="Installed AND NOT REINSTALL" />
<Custom Action="CreateSudoCurrentFolderLink" Before="InstallFinalize" Condition="NOT Installed" />
<Custom Action="RemoveSudoCurrentFolderLink" After="InstallInitialize" Condition="Installed AND NOT REINSTALL" />
<Custom Action="RemoveInstallFolder" After="InstallInitialize" Condition="REMOVE AND NOT UPGRADINGPRODUCTCODE" />
</InstallExecuteSequence>
Expand Down Expand Up @@ -112,12 +112,12 @@
</Fragment>

<Fragment>
<CustomAction Id="CreateSudoExeLink" Directory="VERSIONFOLDER" ExeCommand="cmd /c mklink sudo.exe &quot;[VERSIONFOLDER]gsudo.exe&quot;" Execute="deferred" Return="ignore" Impersonate="no" />
<CustomAction Id="RemoveSudoExeLink" Directory="VERSIONFOLDER" ExeCommand="cmd /c DEL sudo.exe" Execute="deferred" Return="ignore" Impersonate="no" />
<CustomAction Id="CreateSudoExeLink" Directory="VERSIONFOLDER" ExeCommand="cmd /c mklink sudo.exe &quot;[INSTALLFOLDER]Current\gsudo.exe&quot;" Execute="deferred" Return="ignore" Impersonate="no" />
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Point the sudo.exe symlink at the install folder's Current junction.

<CustomAction Id="RemoveSudoExeLink" Directory="INSTALLFOLDER" ExeCommand="cmd /c DEL &quot;[INSTALLFOLDER]Current\sudo.exe&quot;" Execute="deferred" Return="ignore" Impersonate="no" />
<CustomAction Id="CreateSudoCurrentFolderLink" Directory="INSTALLFOLDER" ExeCommand="cmd /c mklink /J &quot;[INSTALLFOLDER]Current&quot; &quot;[VERSIONFOLDER]&quot;" Execute="deferred" Return="ignore" Impersonate="no" />
<CustomAction Id="RemoveSudoCurrentFolderLink" Directory="INSTALLFOLDER" ExeCommand="cmd /c RD /S /Q &quot;[INSTALLFOLDER]Current&quot;" Execute="deferred" Return="ignore" Impersonate="no" />
<CustomAction Id="RemoveInstallFolder" Directory="INSTALLFOLDER" ExeCommand="cmd /c RD /S /Q &quot;[INSTALLFOLDER]&quot;" Execute="deferred" Return="ignore" Impersonate="no" />
</Fragment>

</Wix>