Wix在安装期间不会接触AppData文件夹
所以我已经研究这个问题好几天了。我的安装程序不会在windows中的roaming AppData文件夹中添加或删除任何内容。我是Wix新手,这是我的第一个安装程序。该程序还附带了一个Bootstrapper,它安装了各种特权和.NET框架。我使用的代码如下Wix在安装期间不会接触AppData文件夹,wix,Wix,所以我已经研究这个问题好几天了。我的安装程序不会在windows中的roaming AppData文件夹中添加或删除任何内容。我是Wix新手,这是我的第一个安装程序。该程序还附带了一个Bootstrapper,它安装了各种特权和.NET框架。我使用的代码如下 <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="USBackup" Language="1033" Version="!(bind.fileVersion.USBackup.exe)" Manufacturer="Ed Rose" UpgradeCode="795ea019-054a-4f34-8c9a-cb4e607897c0">
<Package Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<Icon Id="icon.ico" SourceFile="..\USBackup\resources\usb.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes"/>
<UIRef Id="WixUI_Minimal" />
<UIRef Id="WixUI_ErrorProgressText" />
<PropertyRef Id="NETFRAMEWORK45"/>
<Condition Message='This setup requires the .NET Framework 4.5 installed.'>
<![CDATA[Installed OR NETFRAMEWORK45]]>
</Condition>
<Feature Id="ProductFeature" Title="Setup" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id='ProgramMenuDir' />
<ComponentRef Id='AppDataDir'/>
<ComponentRef Id='DevicesDir'/>
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="USBackup" />
</Directory>
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuDir" Name="USBackup">
<Component Id="ProgramMenuDir" Guid="{B01A59A5-ADA0-43FD-B14F-D479CD002E72}">
<RemoveFolder Id='ProgramMenuDir' On='uninstall' />
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
</Component>
</Directory>
</Directory>
<Directory Id="CommonAppDataFolder" Name="CommonAppData">
<Directory Id="AppDataDir" Name="USBackup">
<Component Id="AppDataDir" Guid="{573BF504-1F52-40FE-A78A-96F43924379E}">
<RemoveFolder Id="AppDataDir" On="uninstall"/>
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
</Component>
<Directory Id="DevicesDir" Name="Devices">
<Component Id="DevicesDir" Guid="{E145EA47-109F-42E7-ABAB-4E9A87FEC464}">
<RemoveFolder Id="DevicesDir" On="uninstall"/>
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Guid="{9D9BA12C-0859-46F0-B5E1-2A59BE96F83D}">
<File Source="$(var.USBackup.TargetPath)" KeyPath="yes">
<Shortcut Id="start" Directory="ProgramMenuDir" Name="USBackup" WorkingDirectory='INSTALLDIR' Icon="icon.ico" IconIndex="0" Advertise="yes" />
</File>
</Component>
<Component Guid="{6B473C52-6901-4FAC-A48B-20FC13A49C21}">
<File Source="..\USBackup\bin\Release\AutoUpdater.NET.dll" KeyPath="yes"/>
</Component>
<Component Guid="{6191F8CC-98A8-4424-A846-44DC1EB2A22C}">
<File Source="..\USBackup\bin\Release\USBackup.exe.config" KeyPath="yes"/>
</Component>
<Component Guid="{4E183A88-69DE-49D1-9142-13A2346443AF}">
<File Source="..\USBackup\bin\Release\USBackup.exe.manifest" KeyPath="yes"/>
</Component>
<!--Set to open on startup-->
<Component Id="RegistryKey" Guid="{8DBAB7DD-D9CD-4EC4-97F9-9A6131B40108}" Shared="yes">
<RegistryKey Root="HKCU" Key="Software\Microsoft\Windows\CurrentVersion\Run">
<RegistryValue Id="startupValue" Action="write" Name="USBackup" Value="[INSTALLFOLDER]USBackup.exe" Type="string"/>
</RegistryKey>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
它构建时没有错误或警告。为什么它不触及AppData目录?您还没有给出创建它的任何理由 包括
,因此
<Component Id="AppDataDir" Guid="{573BF504-1F52-40FE-A78A-96F43924379E}">
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
<CreateFolder />
</Component>
也许您选择了错误的目录:您可能尝试Process Monitor(procmon,Sysinternals工具的一部分)来查看运行时发生的情况。是否在尝试打开目录时出错,或者可能为其生成了错误的名称?这通常非常有启发性。您已经安装了InstallScope=“perMachine”。。不幸的是,AppData不起作用——事实上,我曾经有过标记,但出于某种原因,它不在我发布的代码片段中——可能我只是在试验。我已经尝试将组件添加到主组件组中,并且尝试使用不同顺序的标记,以防出现一些奇怪的错误,使其无法按不同顺序工作,但没有效果。是否有任何其他可能阻止它从该目录添加或删除文件夹的操作?