windows 自动运行 CD 上的 MSI 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/319811/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 11:39:31  来源:igfitidea点击:

Autorun an MSI file on CD

windowswindows-installer

提问by Adam Pierce

Does anyone have an example AUTORUN.INF which can launch an MSI installer automatically when the user inserts the CD.

有没有人有一个示例 AUTORUN.INF,它可以在用户插入 CD 时自动启动 MSI 安装程序。

I'm sure this can be done but I've been Googling around for ages and have not found any working solution.

我确信这可以做到,但我已经搜索了很长时间,但没有找到任何可行的解决方案。

UPDATE:I have an AUTORUN.INF similar to this but it won't launch the installer:

更新:我有一个与此类似的 AUTORUN.INF,但它不会启动安装程序:

[autorun]
open=MyInstaller-1.0.0.msi
label=My CD Label
icon=MyIcon.ico

采纳答案by Ray

Try shellexecute= instead of open=

尝试 shellexecute= 而不是 open=

[autorun]
shellexecute=MyInstaller-1.0.0.msi
label=My CD Label
icon=MyIcon.ico

回答by Adam Pierce

I can answer my own question. After reading the articles linked by Ray, I have created the following AUTORUN.INF which works:

我可以回答我自己的问题。阅读 Ray 链接的文章后,我创建了以下有效的 AUTORUN.INF:

[autorun]
shellexecute=MyInstaller-1.0.0.msi
label=My CD Label
icon=MyIcon.ico

The AUTORUN.INF file is placed in the root directory of the CD along with the icon file and msi file referred to.

AUTORUN.INF 文件与引用的图标文件和 msi 文件一起放置在 CD 的根目录中。