开发者

Wix - Keep Folders after uninstall

开发者 https://www.devze.com 2023-01-24 07:34 出处:网络
I want to create an installer using Wix that copies a certain file to the folder \"C:\\Users\\Your User\\Documents\\Visual Studio 2010\\Addins\\\"

I want to create an installer using Wix that copies a certain file to the folder "C:\Users\Your User\Documents\Visual Studio 2010\Addins\"

When I write the following code:

<Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="PersonalFolder">
      <Directory Id="VS2010" Name="Visual Studio 2010">
        <D开发者_StackOverflow中文版irectory Id="VSAddins" Name="Addins">
          <Component Id="VSAddin" Guid="Some Guid">
            <File Id="MyAddin.Addin" Name="MyAddin.Addin" DiskId="1" Source="..\Resources\" />
            <RegistryValue Root='HKCU' Key='SOFTWARE\ABCD\MY_Addins'
                           Type='string' Value='MY_Addin'
                           KeyPath='yes' />
          </Component>
        </Directory>

I get the following compilation error:

ICE64: The directory VS2010 is in the user profile but is not listed in the RemoveFile table.

How can I overcome this error?

I know that i can add the following code inside the "Component" scope:

<RemoveFolder Id="VS2010" On='uninstall'/>

But I don't want the uninstall to delete folders that i didn't create (Especially the Visual Studio 2010 one...)

Thank you for your help, Maxim


May I ask why you are putting it in the users's profile instead of installing it for all users? I find per-user components create all kinds of servicing problems downn the road. Instead, for my IsWiX project I deploy my AddIn to C:\ProgramData\Microsoft\MSEnvShared\AddIns.

You can take a look at the full source at IsWiXAddInMM.wxs

0

精彩评论

暂无评论...
验证码 换一张
取 消