windows 制作自动运行应用程序的最佳解决方案?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/459955/
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
Best solution for making an Autorun application?
提问by Superdumbell
For my work I need to create a Autorun application for a CD for our client. The problem is all I'm a C# programmer by trade and .NET does not make for the best autoruns since not all computers will have .NET installed on them.
对于我的工作,我需要为我们的客户创建一个用于 CD 的 Autorun 应用程序。问题在于,我是一名 C# 程序员,而 .NET 无法实现最佳自动运行,因为并非所有计算机都安装了 .NET。
What is a good solution that will work on Win98-Vista computers?
什么是适用于 Win98-Vista 计算机的好的解决方案?
回答by Lusid
The answer to this question is really one of preference. Technically, anything can be instructed to open as an autorun. The autorun.inf file is simply an instruction file that Windows knows how to read in order to determine what it should do when a CD is inserted. That could be an application (written in any language you choose), a powerpoint presentation, opening a link to a website, etc. As long as you follow the rules of the autorun.inf file:
这个问题的答案确实是一种偏好。从技术上讲,可以指示任何东西作为自动运行打开。autorun.inf 文件只是一个指令文件,Windows 知道如何读取它以确定插入 CD 时应该执行的操作。这可以是一个应用程序(用您选择的任何语言编写)、一个powerpoint 演示文稿、打开一个网站的链接等。只要您遵循 autorun.inf 文件的规则:
回答by Stefan
There are many small autorun-utils (some free) that are configurable. I would go for one of those.
有许多可配置的小型自动运行工具(有些是免费的)。我会去其中之一。
回答by Héctor Vergara
You need two things:
你需要两件事:
Follow this steps (http://support.microsoft.com/kb/324733OR http://support.microsoft.com/kb/888469)
When your application is ready (with bootstrapper), you'll have to create a autorun.inf file on CD root path. Search 'autorun.inf create' on your favorite Search Engine.
按照以下步骤操作(http://support.microsoft.com/kb/324733或http://support.microsoft.com/kb/888469)
当您的应用程序准备好(使用引导程序)时,您必须在 CD 根路径上创建一个 autorun.inf 文件。在您最喜欢的搜索引擎上搜索“autorun.inf create”。
回答by Alex Shirshov
It is possible using Mono's bundling feature:
可以使用 Mono 的捆绑功能:
"The resulting executable is self contained and does not need the Mono runtime installed to run."
“生成的可执行文件是自包含的,不需要安装 Mono 运行时即可运行。”
Mono is an Open Source .Net clone and shouldbe able to run most .Net applications. See "Bundles" section here: http://www.mono-project.com/Guide:Running_Mono_Applications
Mono 是一个开源的 .Net 克隆,应该能够运行大多数 .Net 应用程序。请参阅此处的“捆绑包”部分:http: //www.mono-project.com/Guide: Running_Mono_Applications
回答by Rosstified
You could use .hta file on CD to launch as splash page, and from there detect if .NET is installed (using COM from HTA file) and then run your custom executable.
您可以使用 CD 上的 .hta 文件作为启动页面启动,然后检测是否安装了 .NET(使用来自 HTA 文件的 COM),然后运行您的自定义可执行文件。
.hta files are what Microsoft SQL Server (and most of their others) installation cd uses from memory, easy to make them look very professional (its just html in the background basically)
.hta 文件是 Microsoft SQL Server(以及大多数其他人)安装 cd 从内存中使用的文件,易于使它们看起来非常专业(基本上只是后台的 html)
回答by Mark Turner
There was a program from Macrovision called "Demoshield" that worked well back in the day. I'm not sure if its available anymore, but it was an alright program for creating the auto-run programs.
Macrovision 有一个名为“Demoshield”的程序,当时运行良好。我不确定它是否不再可用,但它是用于创建自动运行程序的好程序。
回答by Eclipse
You can include the runtime with the CD, but you'll have to install it before running your app. You might look into just popping open an html file from the CD.
您可以在 CD 中包含运行时,但您必须在运行应用程序之前安装它。您可能会考虑从 CD 中弹出一个 html 文件。
Otherwise, you can look at writing a small native program that can prompt to install the runtime if it's not there, or run your .NET app if it is.
否则,您可以考虑编写一个小型本机程序,如果它不存在,它可以提示安装运行时,或者运行您的 .NET 应用程序(如果存在)。
回答by Wouter van Nifterick
Try Delphi; it's by far the best way to create native win32 application nowadays.
试试德尔福;它是目前创建本机 win32 应用程序的最佳方式。
It creates slick stand-alone .exe files with rich GUI's that don't need any runtime libraries or other annoying dependencies. Works on any windows machine.
它使用不需要任何运行时库或其他烦人的依赖项的丰富 GUI 创建流畅的独立 .exe 文件。适用于任何 Windows 机器。