WiX -- 将文件安装到系统驱动器 [英] WiX -- Installing files to system drive

查看:35
本文介绍了WiX -- 将文件安装到系统驱动器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个安装程序,它将一些文件放入另一个应用程序中,该应用程序将其文件保存在 [SystemDrive]\appName.安装程序只用于内部自动化,所以不考虑其他安装位置也没关系.

I'm working on an installer that drops some files into another application that keeps its files at [SystemDrive]\appName. The installer is only used in internal automation, so it's fine if it doesn't consider other install locations.

我发现默认情况下,WiX 会将目标目录设置为可用空间最多的驱动器.在系统驱动器中指定某个目录的最佳方法是什么?

I've found that by default WiX sets the target directory to the drive with the most free space. What's the best way to specify a certain directory in the system drive instead?

推荐答案

将rootdrive的值设置为你想要的驱动器

Set the value of rootdrive to the drive you want

<CustomAction Id='SetRootDrive' Property='ROOTDRIVE' Value='[%SystemDrive]\'/>

系统驱动器将默认为操作系统使用的默认驱动器

System drive will be by default the default drive used by OS

添加了调用SetRootDrive"操作的代码:你需要从 InstallUISequence 调用它

Added code to call 'SetRootDrive' action: You need to call it from InstallUISequence

<InstallUISequence>
  <Show Dialog="MyWelcomeDlg" Before="CostFinalize">NOT Installed</Show>
  <!-- App search is what does FindInstallLocation, and it is dependent on FindRelatedProducts -->
  <AppSearch After="FindRelatedProducts"/>
  <Custom Action="SetRootDrive" Before="CostInitialize"></Custom>
</InstallUISequence>

这篇关于WiX -- 将文件安装到系统驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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