维克斯 - 设置Installdirectory动态超过CustomAction [C#] [英] WiX - Set Installdirectory dynamically over CustomAction [C#]

查看:181
本文介绍了维克斯 - 设置Installdirectory动态超过CustomAction [C#]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建一个安装程序,现在我需要设置不同的运行系统的安装目录。我的目录树:

 <资源ID =TARGETDIRVALUE =C:\/> 
<目录ID =TARGETDIRNAME =SourceDir>
<目录ID =targetdirectory中NAME =MyApplication的>
<目录ID =CONFIGNAME =配置>
<目录ID =FOLDER2NAME =FOLDER2/>
< /目录>
< /目录>
< /目录>

如果我设置在c#-custom行动targetdirectory中,targetdirectory中获取设置正确,但CONFIG / FOLDER2只是有旧链接。我怎样才能迫使他们调整到新的道路?因为他们是targetdirectory中的孩子的,我想他们应该会自动执行此操作。我不想把它所有我自己在CustomAction,因为甚至还有更多的文件夹,正在添加



在这里从日志文件:

 属性(S):FOLDER2 = C:\MyApplication\Config\Folder2\ 
属性(S):CONFIG = C: \MyApplication\Config\
属性(S):targetdirectory中= C:\Documents和Settings\MyApplication\
属性(S):TARGETDIR = C:\


解决方案

可以解决的SetProperty问题:

 <资源ID =targetdirectory中VALUE =C:\Win7\/> :\WinXP\ C> 
<的SetProperty n =targetdirectory中=CostFinalize值=前
<![CDATA [VersionNT = 501]]>
< /&的SetProperty GT;


I'm about to create an installer, now i have to set the install-directory depending on the operation-system. My directory-tree:

<Property Id="TARGETDIR" Value="C:\" />
<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="TARGETDIRECTORY" Name="MyApplication">
    <Directory Id="CONFIG" Name="Config">
      <Directory Id="FOLDER2" Name="Folder2" />
    </Directory>
  </Directory>
</Directory>

if i set the TARGETDIRECTORY in the c#-custom-action, the targetdirectory gets set correct, but the CONFIG/FOLDER2 just have the old links. How can i force them to adjust them to the new paths? because they are childs of the TARGETDIRECTORY, i guess they should do this automatically. I dont want to set it all on my own in the CustomAction, because there are even many more folders comming

here from the log file:

Property(S): FOLDER2 = C:\MyApplication\Config\Folder2\
Property(S): CONFIG = C:\MyApplication\Config\
Property(S): TARGETDIRECTORY = C:\Documents and Settings\MyApplication\
Property(S): TARGETDIR = C:\

解决方案

could solve the problem with SetProperty:

<Property Id="TARGETDIRECTORY" Value="C:\Win7\" />
<SetProperty Id="TARGETDIRECTORY" Before="CostFinalize" Value="C:\WinXP\">
  <![CDATA[VersionNT = 501]]>
</SetProperty>

这篇关于维克斯 - 设置Installdirectory动态超过CustomAction [C#]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆