Windows 中的自动播放和自动运行困难
我现在感觉很傻,但几天来,我已经完全被 Windows 的自动播放和自动运行功能搞糊涂了。本质上,我开发了一些将通过光学介质(例如 CD-ROM、DVD-ROM)部署的软件。在完美的世界中,我们的客户希望用户能够简单地插入 CD 并开始比赛。
我们已经向他们解释过,Windows 的实际自动运行和自动播放功能将完全取决于个人用户在其计算机上的设置。但即便如此,在我自己的机器上,我一直无法检测和使用“autorun.inf”文件。
软件本身是使用从 VBScript 启动的 .msi 文件安装的。由于 .vbs 文件不是直接可执行文件,因此我编写了一个名为 setup.exe 的简单引导程序可执行文件。这是我非常简单的“autorun.inf”文件:
[autorun]
open=setup.exe
就是这样。没什么大不了的。如果我手动双击 setup.exe,一切都会按预期进行。但是,如果我将所有必要的安装文件复制到光盘(真实或虚拟驱动器)并插入媒体,我在自动播放中没有“安装或运行程序...”的选项
我尝试调整我的系统自动播放设置为始终安装,以及“每次都询问我”。我不确定 Windows 是否未将我的光盘识别为“软件和游戏”光盘,或者只是忽略了我的 autorun.inf 文件。
无论如何,无论我尝试什么,每当我对此进行测试时,我只能获得自动播放的“常规选项”部分以及“打开文件夹以查看文件”的选择。
I feel pretty dumb at the moment, but for several days now, I have been completely confounded by the AutoPlay and AutoRun features of Windows. In essence, I have developed some software that will be deployed via optical media (e.g., CD-ROM, DVD-ROM). In a perfect world, our client wants the user to be able to simply pop in the CD and be off to the races.
We have explained to them that the actual AutoRun and AutoPlay features of Windows will be completely subject to the individual user's settings on his or her computer. But even with that said, on my own machine, I have been unable to detect and use an "autorun.inf" file.
The software itself is installed using a .msi file that is launched from a VBScript. Because the .vbs file is not directly an executable, I wrote a simple bootstrapper executable called setup.exe. Here is my very simple "autorun.inf" file:
[autorun]
open=setup.exe
That's it. No big deal. If I manually double-click the setup.exe, everything proceeds as expected. However, if I copy all of the necessary setup files to a disc (real or virtual drive) and insert the media, I do not have the option in AutoPlay to "Install or run program..."
I have tried tweaking my system AutoPlay settings to always install, and also to "Ask me every time." I am not sure whether Windows is not recognizing my disc as a "Software and Games" disc, or if it is just ignoring my autorun.inf file.
In any event, no matter that I try, whenever I test this out, I ONLY get the "General options" section of AutoPlay with the choice of "Open folder to view files."
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
Try this: