简体   繁体   English

坚持在WIX主要升级中保留配置文件!

[英]Stuck on preserving config file in WIX major upgrade!

ARGH! 哎呀! Wix is driving me crazy. 威克斯让我抓狂。

So, of course I have seen the many posts both here on stackoverflow and elsewhere about WiX and major upgrades. 所以,当然我已经在stackoverflow和其他地方看到了很多关于WiX和主要升级的帖子。 I inherited this software project using WiX and am releasing a new version. 我使用WiX继承了这个软件项目并发布了新版本。 I need this new version to leave ONLY the one configuration file if it's present, and replace everything else. 我需要这个新版本只留下一个配置文件(如果它存在),并替换其他所有内容。 This installer works EXCEPT no matter what I have done so far, the new XML file replaces the old on every install. 无论我到目前为止做了什么,这个安装程序都可以工作,新的XML文件在每次安装时都会替换旧文件。 Even attempting to use NeverOverwrite="yes" and even trying and messing back and forth with OnlyDetect="no"! 甚至尝试使用NeverOverwrite =“是”,甚至尝试使用OnlyDetect =“no”来回乱搞! I am simply stuck and humbly request a little guidance. 我只是被困住,谦卑地请求一点指导。 The file that needs to be preserved is called SETTINGS.XML and is in the All Users->ApplicationData directory. 需要保留的文件名为SETTINGS.XML,位于All Users-> ApplicationData目录中。 Here is (most of) my .wxs file! 这是(大部分)我的.wxs文件!

  <Package Id='$(var.PackageCode)' Description="Pathways Directory Software" InstallerVersion="301" Compressed="yes" /> <WixVariable Id="WixUILicenseRtf" Value="License.rtf" /> <Media Id="1" Cabinet="Pathways.cab" EmbedCab="yes" /> <Upgrade Id="$(var.UpgradeCode)"> <UpgradeVersion OnlyDetect="no" Maximum="$(var.ProductVersion)" IncludeMaximum="no" Language="1033" Property="OLDAPPFOUND" /> <UpgradeVersion Minimum="$(var.ProductVersion)" IncludeMinimum="yes" OnlyDetect="no" Language="1033" Property="NEWAPPFOUND" /> </Upgrade>  <!-- program files directory --> <Directory Id="ProgramFilesFolder"> <Directory Id="INSTALLDIR" Name="Pathways"/> </Directory> <!-- application data directory --> <Directory Id="CommonAppDataFolder" Name="CommonAppData"> <Directory Id="CommonAppDataPathways" Name="Pathways" /> </Directory> <!-- start menu program directory --> <Directory Id="ProgramMenuFolder"> <Directory Id="ProgramsMenuPathwaysFolder" Name="Pathways" /> </Directory> <!-- desktop directory --> <Directory Id="DesktopFolder" /> </Directory> <Icon Id="PathwaysIcon" SourceFile="\\\\Fileserver\\Release\\Pathways\\Latest\\Release\\Pathways.exe" /> <!-- components in the reference to the install directory --> <DirectoryRef Id="INSTALLDIR"> <Component Id="Application" Guid="EEE4EB55-A515-4872-A4A5-06D6AB4A06A6"> <File Id="pathwaysExe" Name="Pathways.exe" DiskId="1" Source="\\\\Fileserver\\Release\\Pathways\\Latest\\Release\\Pathways.exe" Vital="yes" KeyPath="yes" Assembly=".net" AssemblyApplication="pathwaysExe" AssemblyManifest="pathwaysExe"> <!--<netfx:NativeImage Id="ngen_Pathways.exe" Platform="32bit" Priority="2"/> --> </File> <File Id="pathwaysChm" Name="Pathways.chm" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\Pathways.chm" /> <File Id="publicKeyXml" ShortName="RSAPUBLI.XML" Name="RSAPublicKey.xml" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\RSAPublicKey.xml" Vital="yes" /> <File Id="staticListsXml" ShortName="STATICLI.XML" Name="StaticLists.xml" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\StaticLists.xml" Vital="yes" /> <File Id="axInteropMapPointDll" ShortName="AXMPOINT.DLL" Name="AxInterop.MapPoint.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\AxInterop.MapPoint.dll" Vital="yes" /> <File Id="interopMapPointDll" ShortName="INMPOINT.DLL" Name="Interop.MapPoint.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\Interop.MapPoint.dll" Vital="yes" /> <File Id="mapPointDll" ShortName="MAPPOINT.DLL" Name="MapPoint.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\Interop.MapPoint.dll" Vital="yes" /> <File Id="devExpressData63Dll" ShortName="DAAT63.DLL" Name="DevExpress.Data.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.Data.v6.3.dll" Vital="yes" /> <File Id="devExpressUtils63Dll" ShortName="UTILS63.DLL" Name="DevExpress.Utils.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.Utils.v6.3.dll" Vital="yes" /> <File Id="devExpressXtraBars63Dll" ShortName="BARS63.DLL" Name="DevExpress.XtraBars.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.XtraBars.v6.3.dll" Vital="yes" /> <File Id="devExpressXtraNavBar63Dll" ShortName="NAVBAR63.DLL" Name="DevExpress.XtraNavBar.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.XtraNavBar.v6.3.dll" Vital="yes" /> <File Id="devExpressXtraCharts63Dll" ShortName="CHARTS63.DLL" Name="DevExpress.XtraCharts.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.XtraCharts.v6.3.dll" Vital="yes" /> <File Id="devExpressXtraEditors63Dll" ShortName="EDITOR63.DLL" Name="DevExpress.XtraEditors.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.XtraEditors.v6.3.dll" Vital="yes" /> <File Id="devExpressXtraPrinting63Dll" ShortName="PRINT63.DLL" Name="DevExpress.XtraPrinting.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.XtraPrinting.v6.3.dll" Vital="yes" /> <File Id="devExpressXtraReports63Dll" ShortName="REPORT63.DLL" Name="DevExpress.XtraReports.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.XtraReports.v6.3.dll" Vital="yes" /> <File Id="devExpressXtraRichTextEdit63Dll" ShortName="RICHTE63.DLL" Name="DevExpress.XtraRichTextEdit.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.XtraRichTextEdit.v6.3.dll" Vital="yes" /> <RegistryValue Id="PathwaysInstallDir" Root="HKLM" Key="Software\\Tribal Data Resources\\Pathways" Name="InstallDir" Action="write" Type="string" Value="[INSTALLDIR]" /> </Component> </DirectoryRef> <!-- application data components --> <DirectoryRef Id="CommonAppDataPathways"> <Component Id="CommonAppDataPathwaysFolderComponent" Guid="087C6F14-E87E-4B57-A7FA-C03FC8488E0D"> <CreateFolder> <Permission User="Everyone" GenericAll="yes" /> </CreateFolder> <RemoveFolder Id="CommonAppDataPathways" On="uninstall" /> <RegistryValue Root="HKCU" Key="Software\\TDR\\Pathways" Name="installed" Type="integer" Value="1" KeyPath="yes" /> <File Id="settingsXml" ShortName="SETTINGS.XML" Name="Settings.xml" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\Settings\\settings.xml" Vital="yes" /> </Component> <Component Id="Database" Guid="1D8756EF-FD6C-49BC-8400-299492E8C65D"> <File Id="pathwaysMdf" Name="Pathways.mdf" DiskId="1" Source="\\\\fileserver\\Shared\\Databases\\Pathways\\SystemDBs\\Pathways.mdf" /> <RemoveFile Id="pathwaysLdf" ShortName="Pathways.ldf" Name="Pathways_log.LDF" On="uninstall" /> </Component> </DirectoryRef> <!-- shortcut components --> <DirectoryRef Id="DesktopFolder"> <Component Id="DesktopShortcutComponent" Guid="1BF412BA-9C6B-460D-80ED-8388AC66703F"> <Shortcut Id="DesktopShortcut" Target="[INSTALLDIR]Pathways.exe" Name="Pathways" Description="Pathways Tribal Directory" Icon="PathwaysIcon" Show="normal" WorkingDirectory="INSTALLDIR" /> <RegistryValue Root="HKCU" Key="Software\\TDR\\Pathways" Name="installed" Type="integer" Value="1" KeyPath="yes"/> </Component> </DirectoryRef> <DirectoryRef Id ="ProgramsMenuPathwaysFolder"> <Component Id="ProgramsMenuShortcutComponent" Guid="83A18245-4C22-4CDC-94E0-B480F80A407D"> <Shortcut Id="ProgramsMenuShortcut" Target="[INSTALLDIR]Pathways.exe" Name="Pathways" Icon="PathwaysIcon" Show="normal" WorkingDirectory="INSTALLDIR" /> <RemoveFolder Id="ProgramsMenuPathwaysFolder" On="uninstall"/> <RegistryValue Root="HKCU" Key="Software\\TDR\\Pathways" Name="installed" Type="integer" Value="1" KeyPath="yes"/> </Component> </DirectoryRef> <Feature Id="App" Title="Pathways Application" Level="1" Description="Pathways software" Display="expand" ConfigurableDirectory="INSTALLDIR" Absent="disallow" AllowAdvertise="no" InstallDefault="local"> <ComponentRef Id="Application" /> <ComponentRef Id="CommonAppDataPathwaysFolderComponent" /> <ComponentRef Id="ProgramsMenuShortcutComponent" /> <Feature Id="Shortcuts" Title="Desktop Shortcut" Level="1" Absent="allow" AllowAdvertise="no" InstallDefault="local"> <ComponentRef Id="DesktopShortcutComponent" /> </Feature> </Feature> <Feature Id="Data" Title="Database" Level="1" Absent="allow" AllowAdvertise="no" InstallDefault="local"> <ComponentRef Id="Database" /> </Feature> <!-- <UIRef Id="WixUI_Minimal" /> --> <UIRef Id ="WixUI_FeatureTree"/> <UIRef Id="WixUI_ErrorProgressText"/> <UI> <Error Id="2000">There is a later version of this program installed.</Error> </UI> <CustomAction Id="NewerVersionDetected" Error="2000" /> <InstallExecuteSequence> <RemoveExistingProducts After="InstallFinalize"/> </InstallExecuteSequence> </Product> 

  <Package Id='$(var.PackageCode)' Description="Pathways Directory Software" InstallerVersion="301" Compressed="yes" /> <WixVariable Id="WixUILicenseRtf" Value="License.rtf" /> <Media Id="1" Cabinet="Pathways.cab" EmbedCab="yes" /> <Upgrade Id="$(var.UpgradeCode)"> <UpgradeVersion OnlyDetect="no" Maximum="$(var.ProductVersion)" IncludeMaximum="no" Language="1033" Property="OLDAPPFOUND" /> <UpgradeVersion Minimum="$(var.ProductVersion)" IncludeMinimum="yes" OnlyDetect="no" Language="1033" Property="NEWAPPFOUND" /> </Upgrade>  <!-- program files directory --> <Directory Id="ProgramFilesFolder"> <Directory Id="INSTALLDIR" Name="Pathways"/> </Directory> <!-- application data directory --> <Directory Id="CommonAppDataFolder" Name="CommonAppData"> <Directory Id="CommonAppDataPathways" Name="Pathways" /> </Directory> <!-- start menu program directory --> <Directory Id="ProgramMenuFolder"> <Directory Id="ProgramsMenuPathwaysFolder" Name="Pathways" /> </Directory> <!-- desktop directory --> <Directory Id="DesktopFolder" /> </Directory> <Icon Id="PathwaysIcon" SourceFile="\\\\Fileserver\\Release\\Pathways\\Latest\\Release\\Pathways.exe" /> <!-- components in the reference to the install directory --> <DirectoryRef Id="INSTALLDIR"> <Component Id="Application" Guid="EEE4EB55-A515-4872-A4A5-06D6AB4A06A6"> <File Id="pathwaysExe" Name="Pathways.exe" DiskId="1" Source="\\\\Fileserver\\Release\\Pathways\\Latest\\Release\\Pathways.exe" Vital="yes" KeyPath="yes" Assembly=".net" AssemblyApplication="pathwaysExe" AssemblyManifest="pathwaysExe"> <!--<netfx:NativeImage Id="ngen_Pathways.exe" Platform="32bit" Priority="2"/> --> </File> <File Id="pathwaysChm" Name="Pathways.chm" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\Pathways.chm" /> <File Id="publicKeyXml" ShortName="RSAPUBLI.XML" Name="RSAPublicKey.xml" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\RSAPublicKey.xml" Vital="yes" /> <File Id="staticListsXml" ShortName="STATICLI.XML" Name="StaticLists.xml" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\StaticLists.xml" Vital="yes" /> <File Id="axInteropMapPointDll" ShortName="AXMPOINT.DLL" Name="AxInterop.MapPoint.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\AxInterop.MapPoint.dll" Vital="yes" /> <File Id="interopMapPointDll" ShortName="INMPOINT.DLL" Name="Interop.MapPoint.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\Interop.MapPoint.dll" Vital="yes" /> <File Id="mapPointDll" ShortName="MAPPOINT.DLL" Name="MapPoint.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\Interop.MapPoint.dll" Vital="yes" /> <File Id="devExpressData63Dll" ShortName="DAAT63.DLL" Name="DevExpress.Data.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.Data.v6.3.dll" Vital="yes" /> <File Id="devExpressUtils63Dll" ShortName="UTILS63.DLL" Name="DevExpress.Utils.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.Utils.v6.3.dll" Vital="yes" /> <File Id="devExpressXtraBars63Dll" ShortName="BARS63.DLL" Name="DevExpress.XtraBars.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.XtraBars.v6.3.dll" Vital="yes" /> <File Id="devExpressXtraNavBar63Dll" ShortName="NAVBAR63.DLL" Name="DevExpress.XtraNavBar.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.XtraNavBar.v6.3.dll" Vital="yes" /> <File Id="devExpressXtraCharts63Dll" ShortName="CHARTS63.DLL" Name="DevExpress.XtraCharts.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.XtraCharts.v6.3.dll" Vital="yes" /> <File Id="devExpressXtraEditors63Dll" ShortName="EDITOR63.DLL" Name="DevExpress.XtraEditors.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.XtraEditors.v6.3.dll" Vital="yes" /> <File Id="devExpressXtraPrinting63Dll" ShortName="PRINT63.DLL" Name="DevExpress.XtraPrinting.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.XtraPrinting.v6.3.dll" Vital="yes" /> <File Id="devExpressXtraReports63Dll" ShortName="REPORT63.DLL" Name="DevExpress.XtraReports.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.XtraReports.v6.3.dll" Vital="yes" /> <File Id="devExpressXtraRichTextEdit63Dll" ShortName="RICHTE63.DLL" Name="DevExpress.XtraRichTextEdit.v6.3.dll" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\DevExpress.XtraRichTextEdit.v6.3.dll" Vital="yes" /> <RegistryValue Id="PathwaysInstallDir" Root="HKLM" Key="Software\\Tribal Data Resources\\Pathways" Name="InstallDir" Action="write" Type="string" Value="[INSTALLDIR]" /> </Component> </DirectoryRef> <!-- application data components --> <DirectoryRef Id="CommonAppDataPathways"> <Component Id="CommonAppDataPathwaysFolderComponent" Guid="087C6F14-E87E-4B57-A7FA-C03FC8488E0D"> <CreateFolder> <Permission User="Everyone" GenericAll="yes" /> </CreateFolder> <RemoveFolder Id="CommonAppDataPathways" On="uninstall" /> <RegistryValue Root="HKCU" Key="Software\\TDR\\Pathways" Name="installed" Type="integer" Value="1" KeyPath="yes" /> <File Id="settingsXml" ShortName="SETTINGS.XML" Name="Settings.xml" DiskId="1" Source="\\\\fileserver\\Release\\Pathways\\Dependencies\\Settings\\settings.xml" Vital="yes" /> </Component> <Component Id="Database" Guid="1D8756EF-FD6C-49BC-8400-299492E8C65D"> <File Id="pathwaysMdf" Name="Pathways.mdf" DiskId="1" Source="\\\\fileserver\\Shared\\Databases\\Pathways\\SystemDBs\\Pathways.mdf" /> <RemoveFile Id="pathwaysLdf" ShortName="Pathways.ldf" Name="Pathways_log.LDF" On="uninstall" /> </Component> </DirectoryRef> <!-- shortcut components --> <DirectoryRef Id="DesktopFolder"> <Component Id="DesktopShortcutComponent" Guid="1BF412BA-9C6B-460D-80ED-8388AC66703F"> <Shortcut Id="DesktopShortcut" Target="[INSTALLDIR]Pathways.exe" Name="Pathways" Description="Pathways Tribal Directory" Icon="PathwaysIcon" Show="normal" WorkingDirectory="INSTALLDIR" /> <RegistryValue Root="HKCU" Key="Software\\TDR\\Pathways" Name="installed" Type="integer" Value="1" KeyPath="yes"/> </Component> </DirectoryRef> <DirectoryRef Id ="ProgramsMenuPathwaysFolder"> <Component Id="ProgramsMenuShortcutComponent" Guid="83A18245-4C22-4CDC-94E0-B480F80A407D"> <Shortcut Id="ProgramsMenuShortcut" Target="[INSTALLDIR]Pathways.exe" Name="Pathways" Icon="PathwaysIcon" Show="normal" WorkingDirectory="INSTALLDIR" /> <RemoveFolder Id="ProgramsMenuPathwaysFolder" On="uninstall"/> <RegistryValue Root="HKCU" Key="Software\\TDR\\Pathways" Name="installed" Type="integer" Value="1" KeyPath="yes"/> </Component> </DirectoryRef> <Feature Id="App" Title="Pathways Application" Level="1" Description="Pathways software" Display="expand" ConfigurableDirectory="INSTALLDIR" Absent="disallow" AllowAdvertise="no" InstallDefault="local"> <ComponentRef Id="Application" /> <ComponentRef Id="CommonAppDataPathwaysFolderComponent" /> <ComponentRef Id="ProgramsMenuShortcutComponent" /> <Feature Id="Shortcuts" Title="Desktop Shortcut" Level="1" Absent="allow" AllowAdvertise="no" InstallDefault="local"> <ComponentRef Id="DesktopShortcutComponent" /> </Feature> </Feature> <Feature Id="Data" Title="Database" Level="1" Absent="allow" AllowAdvertise="no" InstallDefault="local"> <ComponentRef Id="Database" /> </Feature> <!-- <UIRef Id="WixUI_Minimal" /> --> <UIRef Id ="WixUI_FeatureTree"/> <UIRef Id="WixUI_ErrorProgressText"/> <UI> <Error Id="2000">There is a later version of this program installed.</Error> </UI> <CustomAction Id="NewerVersionDetected" Error="2000" /> <InstallExecuteSequence> <RemoveExistingProducts After="InstallFinalize"/> </InstallExecuteSequence> </Product> 

First thing you'll probably need to do is get rid of that RemoveFolder in your CommonAppDataPathwaysFolderComponent component. 您可能需要做的第一件事是摆脱CommonAppDataPathwaysFolderComponent组件中的RemoveFolder。 Thats going to delete your directory and everything it contains (including settings.xml). 这将删除您的目录及其包含的所有内容(包括settings.xml)。 Add the neveroverwrite back in and see what happens. 重新添加neveroverwrite,看看会发生什么。

What version of wix are you using? 您使用的是什么版本的wix? 3 right? 3对吗?

Windows installer only installs a component if the keypath is not yet present, or points to a file with a lower version. 如果密钥路径尚不存在,Windows安装程序仅安装组件,或者指向具有较低版本的文件。 In the typical case of a single-file component, wix defaults to using that file as the keypath. 在单文件组件的典型情况下,wix默认使用该文件作为密钥路径。 In this case the keypath of the CommonAppDataPathwaysFolderComponent component is a registry key; 在这种情况下, CommonAppDataPathwaysFolderComponent组件的密钥路径是一个注册表项; it has been explicitly marked with the keypath=yes attribute. 它已使用keypath=yes属性明确标记。

You schedule the uninstall of the old version after the installation of the new version. 您安装新版本后安排卸载旧版本。 So if the keypath for this component is the same for the old and the new version, then things should work as you want. 因此,如果此组件的键路径对于旧版本和新版本是相同的,那么事情应该按照您的意愿工作。

The fact that it does not work, implies that you have changed the keypath of the component. 它不起作用的事实意味着您已经更改了组件的键路径。 Apparently the old installer did not write a "Software\\TDR\\Pathways, Installed=1" value to the registry. 显然旧的安装程序没有向注册表写入“Software \\ TDR \\ Pathways,Installed = 1”值。 The new installer looks for this registry key, doesn't find it, and decides to install the CommonAppDataPathwaysFolderComponent - overwriting the old SETTINGS.XML file in the process. 新安装程序查找此注册表项,找不到它,并决定安装CommonAppDataPathwaysFolderComponent - 在此过程中覆盖旧的SETTINGS.XML文件。

when running your code in a test I got this warning 在测试中运行代码时,我收到了此警告

warning LGHT1076 : ICE57: Component 'CommonAppDataPathwaysFolderComponent' has both pe r-user and per-machine data with an HKCU Registry KeyPath. 警告LGHT1076:ICE57:组件'CommonAppDataPathwaysFolderComponent'具有HKCU Registry KeyPath的pe-user和per-machine数据。

and The error in the log file whilst running your code is this 和运行代码时日志文件中的错误是这样的

C:\\Documents and Settings\\All Users\\Application Data\\Pathways\\Settings.xml; C:\\ Documents and Settings \\ All Users \\ Application Data \\ Pathways \\ Settings.xml; Overwrite; 覆盖; Won't patch; 不会补丁; Existing file is unversioned and unmodified - hash doesn't match source file 现有文件是未版本化且未修改的 - 哈希与源文件不匹配

Which indicates the xml file component has per machine data (the xml file) with a per user registry key path. 这表示xml文件组件具有每个用户注册表键路径的每个机器数据(xml文件)。

Use the xml file as a keypath for the component like so: 使用xml文件作为组件的键路径,如下所示:

<Component Id="CommonAppDataPathwaysFolderComponent" Guid="087C6F14-E87E-4B57-A7FA-C03FC8488E0D">
    <CreateFolder>
        <Permission User="Everyone" GenericAll="yes" />
    </CreateFolder>

    <RemoveFolder Id="CommonAppDataPathways" On="uninstall" />
    <File Id="settingsXml" KeyPath="yes" ShortName="SETTINGS.XML" Name="Settings.xml" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\Settings\settings.xml" Vital="yes" />
</Component>

This will make Windows Installer use unversioned file comparison when deciding whether or not to replace this file. 这将使Windows Installer在决定是否替换此文件时使用无版本文件比较。

you have correctly scheduled RemoveExistingProducts action after the InstallFiles action which makes sure that the new versions are installed before removing the old versions. 您已在InstallFiles操作之后正确安排了RemoveExistingProducts操作,以确保在删除旧版本之前安装了新版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM