简体   繁体   English

Windows Installer:安装后运行exe

[英]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.exejax.exe等)的存在并读取msi( a.configb.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.

相关问题 如何在Windows Installer安装过程中运行第三者exe(使用安装和部署项目) - how to run a 3rd party exe during a windows installer installation (using setup and deployment project) .Net Windows .exe应用程序在安装后出现错误 - .Net windows .exe Application gives an error after installation 是什么启动Windows Service Installer的安装? - What launches the installation of a Windows Service Installer? 安装 C# 后,使用 WPF 应用程序无法使用 SC.exe 创建 windows 服务 - Cannot create a windows service with SC.exe using WPF App after its installation C# Windows Store App运行.msi安装程序 - Windows Store App running .msi installer 安装前运行自定义操作 - Visual Studio 安装程序 - Running Custom Action before installation - Visual studio installer 首次安装后如何禁用exe文件? - How to disable an exe file after first installation? 运行InstallShield安装程序后未安装应用程序 - Application not installed after running InstallShield installer 安装后多个Project MSI安装程序未运行 - Multiple Project MSI Installer not running after install InstallShield exe应在安装后静默启动特定的exe - InstallShield exe should silently start specific exe after installation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM