跨平台自动运行
我正在用 qt 编写一个程序,该程序将安装在闪存驱动器上。我需要它在插入后立即在多个操作系统上运行。我想我可以通过将所有不同的操作系统编译放在单独的文件夹中并在驱动器的第一部分中为每个操作系统自动运行来做到这一点。这行得通吗?它应该有点像 sandisks u3,事实上,它一插入电源就会弹出并从驱动器上运行。
I am writing a program in qt that will be installed on a flash drive. I need it to run on several operating systems as soon as it is plugged in. I was thinking I could do this by putting all of the different os compiles in separate folders and having the autorun for each os in the first part of the drive. Would this work? It is supposed to be somewhat like sandisks u3 in the fact that it pops up as soon as it is plugged in and runs off the drive.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它肯定会起作用 - 基本上每个自动运行配置文件都是特定于操作系统的,并且您可以准确指定要在插件上运行的可执行文件。
Sandisk U3 平台是围绕典型 Windows 设置的一个相当狡猾的技巧,它禁止从闪存设备自动运行,但允许在 CDrom 驱动器上自动运行。 U3 设备有两个分区,其中一个分区(约 16MB)保存 ISO 映像,与特殊的 USB 控制器一起被识别为光驱。
如果您可以使用其中一个驱动器,则可以对其进行重新编程以执行您想要的任何其他操作。
It would certainly work - basically each autorun configuration file is OS specific, and you can specify exactly which executable to run on plug-in.
The Sandisk U3 platform is a rather devious trick around a typical Windows setting, which forbids autorun from a flash device, but allows it nonetheless on an CDrom drive. U3 device has two partitions, one of which (around 16MB) holds an ISO image, that, together with the special USB controller, gets recognized as an optical drive.
If you can get a hand on one of those drives, they can be reprogrammed to do anything else you want.
我有一个朋友在他的拇指驱动器上修复了自动同步脚本。
在 Windows 上,它基本上归结为单个 AutoRun.inf 文件。
其他平台不知道。在 Linux 上,它可能取决于桌面环境和安全设置。
I had a friend that fixed an auto-sync script on his thumb drive.
On Windows it basically boils down to a single AutoRun.inf file.
On other platforms, I don't know. On Linux, it will probably depend on Desktop Environment and security settings.