How to package a BAT in Visual installer and how to run a BAT file during MSI installation?

自闭症网瘾萝莉.ら 提交于 2019-12-12 01:03:46

问题


I have a BAT file with this content:

"XYNTService.exe" "-i"

I am currently building up an installation package using Visual Studio Installer. I added this BAT file inside the Application Folder. Now I want to execute it during installation process. How can it be done?

I have surf a lot about custom actions, but still fail to understand how to do it. Need help.

Thank you.


回答1:


Ultimately, you can always run a batch file by doing ShellExecute or CreateProcess on cmd.exe with the relevant parameters.

However, rememeber that MSI custom actions run in a different user context from the user who is installing. You may struggle to get the batch file to do what you want to.

Martyn



来源:https://stackoverflow.com/questions/6658887/how-to-package-a-bat-in-visual-installer-and-how-to-run-a-bat-file-during-msi-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!