gpt4 book ai didi

visual-studio-2012 - 使用wix在程序数据中添加文件

转载 作者:行者123 更新时间:2023-12-02 04:52:00 25 4
gpt4 key购买 nike

我正在使用 addin express 开发 Outlook 插件。我在程序的安装项目中使用了 .wxs 文件。它帮助我在 roaming 文件夹中安装我的程序。我想将 Redemption.dll 添加到路径 C:\programData\Flow。所以我修改了下面提到的代码。但它不起作用。请给我建议。

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<!--Modified[Id]-->
<Product
Id="faa8e62a-0834-4efa-aad3-b2f7903a3a6c"
Name="FlowOutlook"
Language="1033"
Version="1.1.4"
Manufacturer="Default Company"
UpgradeCode="faa8e62a-0834-4efa-aad3-b2f7903a3a6d"
Codepage="1252">

<Package
InstallerVersion="200"
Compressed="yes"
InstallScope="perUser"
Description="FlowOutlook"
Manufacturer="Default Company"
Languages="1033"
SummaryCodepage="1252"
InstallPrivileges="limited"
/>

<!--Added-->
<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
<Upgrade Id="faa8e62a-0834-4efa-aad3-b2f7903a3a6d">
<!--Should be same as "UpgradeCode"-->
<UpgradeVersion
Minimum="1.0.0" Maximum="1.1.4"
Property="PREVIOUSVERSIONSINSTALLED"
IncludeMinimum="yes" IncludeMaximum="no" />
</Upgrade>

<!--Romoved-->
<!--<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />-->
<Media Id="1" Cabinet="FlowOutlook.cab" EmbedCab="yes" />

<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />

<Feature Id="ProductFeature" Title="FlowOutlook" Level="1" ConfigurableDirectory="INSTALLFOLDER">
<ComponentRef Id="INSTALLFOLDER" />
<ComponentGroupRef Id="ProductComponents" />
<!--<ComponentRef Id="Redemption.dll" />-->
<!--Added-->
</Feature>

<UIRef Id="WixUI_InstallDir" />
<UIRef Id="WixUI_ErrorProgressText" />

<!-- Pics-->
<!-- Pics-->

<Binary Id="adxregistrator_exe" SourceFile="$(var.ADX_PATH)\Redistributables\adxregistrator.exe" />

<CustomAction Id="RegisterApp" BinaryKey="adxregistrator_exe" Execute="deferred" ExeCommand='/install="[INSTALLFOLDER]$(var.FlowOutlook.TargetFileName)" /privileges=user /returnExitCode=false' Impersonate="yes" />
<CustomAction Id="RollbackApp" BinaryKey="adxregistrator_exe" Execute="rollback" ExeCommand='/uninstall="[INSTALLFOLDER]$(var.FlowOutlook.TargetFileName)" /privileges=user' Impersonate="yes" Return="ignore" />
<CustomAction Id="UnregisterApp" BinaryKey="adxregistrator_exe" Execute="deferred" ExeCommand='/uninstall="[INSTALLFOLDER]$(var.FlowOutlook.TargetFileName)" /privileges=user' Impersonate="yes" Return="ignore" />

<!--Added-->
<CustomAction Id="RegisterRedemption32" Directory="INSTALLFOLDER" ExeCommand='regsvr32.exe "C:\ProgramData\Flow\Redemption.dll"'></CustomAction>
<!--self registering Redemption 32-bit -->
<CustomAction Id="UnregisterRedemption32" Directory="INSTALLFOLDER" ExeCommand='regsvr32.exe /u "C:\ProgramData\Flow\Redemption.dll"'></CustomAction>
<!--self unregistering Redemption 32-bit -->
<CustomAction Id="RegisterRedemption64" Directory="INSTALLFOLDER" ExeCommand='regsvr32.exe "C:\ProgramData\Flow\Redemption64.dll"'></CustomAction>
<!--self registering Redemption 64-bit -->
<CustomAction Id="UnregisterRedemption64" Directory="INSTALLFOLDER" ExeCommand='regsvr32.exe /u "C:\ProgramData\Flow\Redemption64.dll"'></CustomAction>
<!--self unregistering Redemption 64-bit -->

<!--Added-->

<InstallExecuteSequence>
<Custom Action="RegisterApp" After="StartServices"><![CDATA[$ProductComponent>2]]></Custom>
<Custom Action="RollbackApp" After="RegisterApp"><![CDATA[$ProductComponent>2]]></Custom>
<Custom Action="UnregisterApp" After="MsiUnpublishAssemblies"><![CDATA[$ProductComponent=2]]></Custom>
<!--Added-->
<RemoveExistingProducts Before="InstallInitialize" />
<Custom Action="RegisterRedemption32" After="InstallFinalize">NOT Installed</Custom>
<!--self registering Redemption 32-bit-->
<Custom Action="UnregisterRedemption32" After="InstallFinalize">REMOVE="ALL"</Custom>
<!--self unregistering Redemption 32-bit-->
<Custom Action="RegisterRedemption64" After="InstallFinalize">NOT Installed</Custom>
<!--self registering Redemption 64-bit-->
<Custom Action="UnregisterRedemption64" After="InstallFinalize">REMOVE="ALL"</Custom>
<!--self unregistering Redemption 64-bit-->
<!--Added-->
</InstallExecuteSequence>

<!-- Properties for all current versions of the .NET Framework are available here: http://wix.sourceforge.net/manual-wix3/wixnetfxextension.htm -->
<PropertyRef Id="NETFRAMEWORK40CLIENT"/>
<Condition Message="This application requires .NET Framework 4.0. Please install the .NET Framework then run this installer again.">
<![CDATA[Installed OR NETFRAMEWORK40CLIENT]]>
</Condition>
</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="AppDataFolder">
<Directory Id="INSTALLFOLDER" Name="FlowOutlook" >
<Component Id="INSTALLFOLDER" Guid="cdca45fb-ce6c-4a00-9865-29b24123c62a">
<RemoveFolder On="both" Id="INSTALLFOLDER"/>
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Value="FlowOutlook" />
</Component>
</Directory>
</Directory>
</Directory>
</Fragment>

<Fragment>
<Directory Id="TARGETDIR2" Name="SourceDir2">
<Directory Id="ProgramFilesFolder">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="Flow"/>
</Directory>
</Directory>
</Fragment>

<Fragment>
<ComponentGroup Id="ProductComponents" >
<Component Id="ProductComponent" Guid="2596359b-ed35-42f1-be52-2ff4625189f5" DiskId="1" Directory="INSTALLFOLDER" >
<RegistryKey Root="HKCU" Key="Software\[Manufacturer]\[ProductName]">
<RegistryValue Type="string" Name="Installed" Value="[INSTALLFOLDER]" KeyPath="yes" />
</RegistryKey>
<File Id="_$(var.FlowOutlook.TargetName)_dll" Name="$(var.FlowOutlook.TargetFileName)" Source="$(var.FlowOutlook.TargetPath)" />
<File Id="_adxloader_dll_manifest" Name="adxloader.dll.manifest" Source="$(var.FlowOutlook.ProjectDir)Loader\" />
<File Id="_adxloader_dll" Name="adxloader.dll" Source="$(var.FlowOutlook.ProjectDir)Loader\" />
<File Id="_adxloader64_dll" Name="adxloader64.dll" Source="$(var.FlowOutlook.ProjectDir)Loader\" />
<File Id="_AddinExpress_MSO_2005_dll" Name="AddinExpress.MSO.2005.dll" Source="C:\Program Files (x86)\Add-in Express\Add-in Express for .NET\Bin\" />
<File Id="_AddinExpress_OL_2005_dll" Name="AddinExpress.OL.2005.dll" Source="C:\Program Files (x86)\Add-in Express\Add-in Express for .NET\Bin\" />

<File Id="_Newtonsoft_Json_dll" Name="Newtonsoft.Json.dll" Source="$(var.FlowOutlook.TargetDir)" />
<File Id="_Microsoft_Vbe_Interop_dll" Name="Microsoft.Vbe.Interop.dll" Source="$(var.FlowOutlook.TargetDir)" />
<File Id="_Newtonsoft_Json_pdb" Name="Newtonsoft.Json.pdb" Source="$(var.FlowOutlook.TargetDir)" />
<File Id="_Newtonsoft_Json_xml" Name="Newtonsoft.Json.xml" Source="$(var.FlowOutlook.TargetDir)" />
<File Id="_Redemption_dll" Name="Redemption.dll" Source="$(var.FlowOutlook.TargetDir2)" />
<File Id="_Newtonsoft_Json_xml" Name="Redemption64.dll" Source="$(var.FlowOutlook.TargetDir2)" />

</Component>
</ComponentGroup>
</Fragment>
</Wix>

感谢您的帮助。库山兰迪玛

最佳答案

C:\驱动器需要管理员权限才能写入。您需要以提升的方式运行安装程序(以管理员身份运行)。

关于visual-studio-2012 - 使用wix在程序数据中添加文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27356264/

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