我对理解WiX安装程序的操作顺序有疑问。
当试图创建一个注册表项添加一个菜单项到Windows资源管理器的上下文菜单,同时使用CustomActions 注册表项将而不是被添加。
但是,如果我只是尝试注册键,它的作品(任何CustomAction代码被注释掉)。同时使用CustomActions时,WiX安装程序创建注册表项不起作用
在我Product.wxs我已升高特权时与
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated"/>
。在我的
<Feature>
我有<ComponentRef Id="RegistryEntries"/>
引用。这是一个用于创建注册表项
<Fragment> <Directory Id="TARGETDIR" Name="SourceDir"> <Component Id="RegistryEntries" Guid="*"> <RegistryKey Root="HKCR" Key="Excel.CSV\shell\Use MyConverter\command" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes"> <RegistryValue Type="string" Value="[INSTALLLOCATION]$(var.SolutionName).exe %1" KeyPath="yes"/> </RegistryKey> </Component> <Directory Id="ProgramFilesFolder"> <Directory Id="HSZLG" Name="MyConverter"> <Directory Id="INSTALLLOCATION" Name="$(var.SolutionName)" /> </Directory> </Directory> <!--<Directory Id="ProgramMenuFolder"> <Directory Id="Shortcuts" Name="MyConverter" /> </Directory>--> </Directory> </Fragment>
现在即时通讯也使用下面的自定义操作代码:
<CustomAction Id="UnregisterImportFormat" BinaryKey="WixCustomAction" DllEntry="UnregisterImportDefinition" Execute="deferred" Impersonate="no" Return="check" /> <CustomAction Id="PropertiesForUnregisterImportFormat" Property="UnregisterImportFormat" Return="check" Value="app=AB;key=10000P1000" />
,并呼吁他们在
<InstallSequence>
这样的:<InstallExecuteSequence> <Custom Action="PropertiesForRegisterImportFormat" Before="RegisterImportFormat" /> <Custom Action="RegisterImportFormat" Before="InstallFinalize">(NOT Installed) OR REINSTALL</Custom> <Custom Action="PropertiesForUnregisterImportFormat" Before="UnregisterImportFormat" /> <Custom Action="UnregisterImportFormat" Before="InstallFinalize">REMOVE</Custom> </InstallExecuteSequence>
如果有人能指出我在这里做错了,我会很高兴感激。
这是我的必读书目:http://www.installsite.org/pages/en/isnews/200108/index.htm –