我有一个WPF应用程序,可以通过某些URL连接到某些Web服务。我进行了安装,它的工作原理像一个咒语,它甚至询问有关URL的信息并按照指示更改.config文件。现在,我想升级该应用程序,但保留.config文件不变。
我在网上尝试了一些解决方案,它不想升级,似乎每次都只能进行全新安装。
<Package InstallerVersion="400" Compressed="yes" InstallScope="perMachine" Platform="x64" />
<Icon Id="icon.ico" SourceFile="$(var.ProjectDir)Icon.ico" />
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<WixVariable Id="WixUIBannerBmp" Value="Images\installer_top-banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="Images\installer_background.bmp" />
<WixVariable Id="WixUILicenseRtf" Value="$(var.ProjectDir)\license.rtf" />
<Property Id="ARPURLINFOABOUT" Value="http://www.Company.com" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<Property Id="FULLURL" Value="http://demo.Company.com/WcfFullPortal.svc" Secure="yes" />
<Property Id="AUTH" Value="0" Secure="yes" />
<Property Id="AUTHVALUE" Value="$(var.httpValue)" Secure="yes" />
<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
<Upgrade Id="1d96517a-8fc5-4150-b1cb-c3adf479a57d">
<UpgradeVersion Minimum="1.0.0.0" Maximum="99.0.0.0" Property="PREVIOUSVERSIONSINSTALLED" IncludeMinimum="yes" IncludeMaximum="no" />
</Upgrade>
<UIRef Id="SetupDialogUI" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch MyApp" />
<Property Id="WixShellExecTarget" Value="[#MyApp.UI.WPF.exe]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." AllowSameVersionUpgrades="yes" Schedule="afterInstallExecute" />
<MediaTemplate EmbedCab="yes" />
<!-- 32-bit / 64-bit variables -->
<?if $(var.Platform) = x64 ?>
<?define bitness = "(64 bit)" ?>
<?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else?>
<?define bitness = "(32 bit)" ?>
<?define Win64 = "no" ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif?>
<Condition Message="Minimum supported OS is Windows 7."><![CDATA[Installed OR (VersionNT >= 600)]]></Condition>
<!--
<?if $(var.Platform) = x64 ?>
<Condition Message="You need to install the 32-bit version of this product on 32-bit Windows.">
<![CDATA[VersionNT64]]>
</Condition>
<?endif?>
<?if $(var.Platform) = x86 ?>
<Condition Message="You need to install the 64-bit version of this product on 64-bit Windows.">
<![CDATA[NOT VersionNT64]]>
</Condition>
<?endif?> -->
</Product>
...
答案 0 :(得分:1)
两种方法:
http://robmensching.com/blog/posts/2010/5/2/the-wix-toolsets-remember-property-pattern/
我是WiX专家,可以轻松处理方法1。对于WiX新手来说,这可能是一个挑战。我通常采用方法1时,它只有少数几个设置,并且该程序是非交互式的,例如Windows服务,或者说是Web应用程序,其中输入是池标识。否则,如果我将复杂性转移到他们能更好理解的代码上,我的客户就会更容易获得支持。