FIX: [0001897] MSI Installer Does Not Ask for Installation Destination (issue #611)

(cherry picked from commit 182981fb0c)
This commit is contained in:
Alexander Koblov 2023-08-03 20:06:01 +03:00
commit b4e4df8810
2 changed files with 45 additions and 8 deletions

View file

@ -52,9 +52,8 @@ copy ..\..\src\doublecmd.ico %BUILD_PACK_DIR%\
pushd %BUILD_PACK_DIR%
del /Q doublecmd\settings\doublecmd.inf
move doublecmd "Double Commander"
heat dir "Double Commander" -ag -cg HeatGroup -dr %PF% -var var.SourcePath -o include.wxs
candle -arch %CPU_TARGET% -dProductVersion=%DC_VER% -dSourcePath="Double Commander" -dProgramFiles=%PF% doublecmd.wxs include.wxs
heat dir doublecmd -ag -cg HeatGroup -srd -dr APPLICATIONFOLDER -var var.SourcePath -o include.wxs
candle -arch %CPU_TARGET% -dProductVersion=%DC_VER% -dSourcePath=doublecmd -dProgramFiles=%PF% doublecmd.wxs include.wxs
light -ext WixUIExtension -cultures:en-us include.wixobj doublecmd.wixobj -o %PACKAGE%.msi
rem Move created package

View file

@ -29,7 +29,7 @@
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.ProgramFiles)">
<Directory Id="INSTALLDIR" Name="$(var.ProductName)">
<Directory Id="APPLICATIONFOLDER" Name="$(var.ProductName)">
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
@ -39,27 +39,65 @@
Id="Shortcut"
Name="$(var.ProductName)"
Description="$(var.ProductName)"
Target="[INSTALLDIR]doublecmd.exe"
WorkingDirectory="INSTALLDIR"/>
Target="[APPLICATIONFOLDER]doublecmd.exe"
WorkingDirectory="APPLICATIONFOLDER"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</Directory>
</Directory>
<Directory Id="DesktopFolder" Name="Desktop">
<Component Id="ApplicationShortcutDesktop" Guid="*">
<Shortcut
Id="ApplicationDesktopShortcut"
Name="$(var.ProductName)"
Description="$(var.ProductName)"
Target="[APPLICATIONFOLDER]doublecmd.exe"
WorkingDirectory="APPLICATIONFOLDER"/>
<RemoveFolder Id="DesktopFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</Directory>
</Directory>
<CustomAction
Id="Overwrite_WixSetDefaultPerMachineFolder"
Property="WixPerMachineFolder"
Value="[$(var.ProgramFiles)][ApplicationFolderName]"
Execute="immediate" />
<InstallUISequence>
<Custom Action="Overwrite_WixSetDefaultPerMachineFolder" After="WixSetDefaultPerMachineFolder" />
</InstallUISequence>
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallValidate"/>
<Custom Action="Overwrite_WixSetDefaultPerMachineFolder" After="WixSetDefaultPerMachineFolder" />
</InstallExecuteSequence>
<Feature Id="DefaultFeature" Level="1">
<Feature Id="DefaultFeature" Level="1" Display="hidden">
<ComponentGroupRef Id="HeatGroup"/>
</Feature>
<Feature Id="ApplicationShortcut" Level="1" Title="Start Menu shortcut">
<ComponentRef Id="ApplicationShortcut" />
</Feature>
<Feature Id="ApplicationShortcutDesktop" Level="1" Title="Desktop shortcut" TypicalDefault="advertise">
<ComponentRef Id="ApplicationShortcutDesktop" />
</Feature>
<WixVariable Id="WixUILicenseRtf" Value="license.rtf" />
<UIRef Id="WixUI_Minimal" />
<Property Id="ApplicationFolderName" Value="$(var.ProductName)" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
<Property Id="ALLUSERS" Secure="yes" Value="2" />
<Property Id="MSIINSTALLPERUSER" Secure="yes" Value="{}" />
<UI>
<UIRef Id="WixUI_Advanced" />
<Publish Dialog="InstallScopeDlg" Control="Next" Property="MSIINSTALLPERUSER" Value="1" Order="3">WixAppFolder = "WixPerUserFolder"</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next" Property="MSIINSTALLPERUSER" Value="{}" Order="2">WixAppFolder = "WixPerMachineFolder"</Publish>
</UI>
</Product>
</Wix>