gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 17:59:59 26 4
gpt4 key购买 nike

啊! Wix 快把我逼疯了。

所以,当然,我在 stackoverflow 和其他地方看到了许多关于 WiX 和重大升级的帖子。我使用 WiX 继承了这个软件项目,并正在发布一个新版本。我需要这个新版本只保留一个配置文件(如果存在),并替换其他所有内容。到目前为止,无论我做了什么,这个安装程序都可以正常工作,新的 XML 文件会在每次安装时替换旧的。甚至尝试使用 NeverOverwrite="yes"甚至尝试使用 OnlyDetect="no"来回搞乱!我只是被困住了,虚心地请求一些指导。需要保留的文件名为 SETTINGS.XML,位于 All Users->ApplicationData 目录中。这是(大部分)我的 .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>

最佳答案

您可能需要做的第一件事是删除 CommonAppDataPathwaysFolderComponent 组件中的 RemoveFolder。这将删除您的目录及其包含的所有内容(包括 settings.xml)。重新添加 neveroverwrite 并查看会发生什么。

你用的是什么版本的wix? 3 对吗?

关于wix - 在 WIX 主要升级中坚持保留配置文件!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2768701/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com