在Windows Installer提交中运行批处理文件 [英] Run batch file in Windows Installer Commit
问题描述
在安装主要输出后,我无法成功修改Windows Installer MSI以运行批处理文件。我已经搜索了此内容,但发现了很多建议,但没有任何建议。
I am having no success in modifying a Windows Installer MSI to run a batch file after the primary output has been installed. I have searched for this and found many suggestions, but nothing that works.
推荐答案
您上面说的不正确:
自定义操作只能是可执行的
文件。批处理文件不可执行。
Custom actions can only be executable files. A batch file is not executable.
自定义操作(即使没有诸如InstallShield之类的工具)也可以是.EXE,VBScript,JScript或DLL。基于。如果您编写DLL,则可以编写任何要调用批处理文件的代码或对系统进行任何更改-没有限制。
Custom Actions (even without tools like InstallShield) can be .EXE, VBScript, JScript, or DLL based. If you write a DLL, you can write whatever code you want to call a batch file or make any changes you want to the system -- there is no limit.
更新:对我有用的示例:(在CustomAction表中输入)
Update: an example that worked for me: (entry in CustomAction table)
Action Test
Type 34
Source SystemFolder
Target cmd.exe /c c:\test.bat
ExtendedType <blank>
这篇关于在Windows Installer提交中运行批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!