[英]windows installer : running exe after installation
I have an msi. 我有一个微星。 In it I have several config files (
a.config
, etc) and exes ( jux.exe
, etc). 在其中,我有几个配置文件(
a.config
等)和exes( jux.exe
等)。
In my msi I created a custom actions - commit for one of the exe (jux.exe). 在我的msi中,我创建了一个自定义操作-提交一个exe(jux.exe)。 I make the
installerclass
false. 我将
installerclass
false。
The idea is for the msi to call jux.exe
right after install. 这个想法是让msi在安装后立即调用
jux.exe
。
jux
can start ok until it tries to validate the existence of some of the files ( jex.exe
, jax.exe
etc.) and reading files inside the msi ( a.config
, b.config
etc). 在尝试验证某些文件(
jex.exe
, jax.exe
等)的存在并读取msi( a.config
, b.config
等)中的文件之前, jux
可以正常运行。 seems like jux.exe
cant find the files. 好像
jux.exe
找不到文件。
Should I not use commit? 我不应该使用提交吗? ideas?
想法?
It's most likely failing because you are making assumptions about the locations of the files, and they are incorrect. 最有可能失败的原因是您对文件的位置进行了假设,并且它们是不正确的。 Your exe is being run from an msiexec.exe with the system account and an unknown working directory.
您的exe正在使用系统帐户和未知工作目录从msiexec.exe运行。 It is not being run from an interactive user shell with explorer setting the working directory and running it with your credentials.
它不是通过使用资源管理器设置工作目录并使用您的凭据运行的交互式用户外壳程序运行的。 If your code just tries to open a.config without specifying the full exact path then it won't find it.
如果您的代码只是尝试打开a.config而不指定完整的确切路径,那么它将找不到它。
All VS custom actions run after everything is installed, so you got lucky there. 所有VS自定义操作都在安装完所有组件后运行,因此您很幸运。 You don't need a Commit custom action - an install custom action will work too.
您不需要Commit自定义操作-安装自定义操作也将起作用。 That will also be called after all the files are installed.
在安装所有文件之后,也将调用该函数。 It's not clear why you want to validate the existence of the files - there's no point.
目前尚不清楚为什么要验证文件的存在-没有意义。 An MSI install either works and installs everything or fails, rolls back and restores the system to its previous state.
MSI安装可以正常工作并安装一切,否则将失败,然后回滚并将系统还原到以前的状态。 So there's no point in checking that it installed files.
因此,检查它是否安装了文件没有意义。
There's no good way around this problem using this project type. 使用此项目类型无法解决此问题。 It simply fails to expose full control over when to schedule your custom action and boils it down to overly simplistic choices.
它根本无法完全控制何时安排您的自定义操作,并将其归结为过于简单的选择。 If I was you I'd factor this custom action out into a WiX merge module and then merge that into your VDPROJ installer (or go full WiX).
如果您是我,则可以将此自定义操作分解为WiX合并模块,然后将其合并到您的VDPROJ安装程序中(或使用完整的WiX)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.