installer now saves and loads the previous install location in the registry

This commit is contained in:
David Sparer
2016-11-29 10:37:54 -07:00
parent 64a40e4ed0
commit 509f7da12e
4 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<!-- http://robmensching.com/blog/posts/2010/5/2/the-wix-toolsets-remember-property-pattern/ -->
<!-- This pattern allows a cmdline value to take precedence over values set from searchers (registry/file/etc) -->
<!-- Save the INSTALLDIR value from the cmdline, if it was provided -->
<CustomAction Id="SaveCmdlineINSTALLDIR" Property="CMDLINE_INSTALLDIR" Value="[INSTALLDIR]" Execute="firstSequence" />
<!-- Set the INSTALLDIR value to the cmdline value, if one was provided -->
<CustomAction Id="SetFromCmdlineINSTALLDIR" Property="INSTALLDIR" Value="[CMDLINE_INSTALLDIR]" Execute="firstSequence" />
<InstallUISequence>
<Custom Action="SaveCmdlineINSTALLDIR" Before="AppSearch" />
<Custom Action="SetFromCmdlineINSTALLDIR" After="AppSearch">
CMDLINE_INSTALLDIR
</Custom>
</InstallUISequence>
<InstallExecuteSequence>
<Custom Action="SaveCmdlineINSTALLDIR" Before="AppSearch" />
<Custom Action="SetFromCmdlineINSTALLDIR" After="AppSearch">
CMDLINE_INSTALLDIR
</Custom>
</InstallExecuteSequence>
</Fragment>
</Wix>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Component Id="C.RegistryEntries" Guid="*">
<RegistryKey Root="HKLM" Key="Software\mRemoteNG">
<RegistryValue Type="string" Name="InstallDir" Value="[INSTALLDIR]" KeyPath="yes" />
</RegistryKey>
</Component>
</DirectoryRef>
</Fragment>
</Wix>

View File

@@ -27,12 +27,14 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="CustomActions\CheckForInstalledWindowsUpdates.wxs" />
<Compile Include="CustomActions\SaveInstallLocation.wxs" />
<Compile Include="CustomActions\UninstallLegacyVersions.wxs" />
<Compile Include="Fragments\FilesFragment.wxs" />
<Compile Include="Fragments\DirectoriesFragment.wxs" />
<Compile Include="Fragments\MainExeFragment.wxs" />
<Compile Include="Fragments\MiscTextFilesFragment.wxs" />
<Compile Include="Fragments\PuTTYNGFragment.wxs" />
<Compile Include="Fragments\RegistryEntriesFragment.wxs" />
<Compile Include="Fragments\ShortcutFragment.wxs" />
<Compile Include="mRemoteNGV1.wxs" />
</ItemGroup>

View File

@@ -27,6 +27,7 @@
<PropertyRef Id="NETFRAMEWORK40FULL" />
<PropertyRef Id="WIX_IS_NETFRAMEWORK_40_OR_LATER_INSTALLED" />
<Icon Id="mRemoteNG.ico" SourceFile="Resources\mRemoteNG.ico" />
<CustomActionRef Id='SaveCmdlineINSTALLDIR' />
<InstallUISequence>
@@ -70,6 +71,7 @@
<ComponentGroupRef Id="MandatoryComponents" Primary="yes" />
<ComponentRef Id="C.MainExe" Primary="yes" />
<ComponentGroupRef Id="CG.ProjectInfoFiles" Primary="yes" />
<ComponentRef Id="C.RegistryEntries" Primary="yes" />
</Feature>
<Feature Id="F.PuttyNG" Title="PuTTYNG" Absent="allow" AllowAdvertise="no" Level="1">