如何为 Windows 创建一个强大的、最小的安装程序? [英] How to create a robust, minimal installer for Windows?

查看:17
本文介绍了如何为 Windows 创建一个强大的、最小的安装程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个具有某些特定属性的安装程序 EXE:

I want to create an installer EXE with some specific properties:

  1. 它应该是一个单独的 exe 文件
  2. 它应该是健壮的(即应该知道该技术在任何 Windows 系统上都能很好地工作)
  3. 它应该只在 %systemroot% 中创建一个文件(一个 .scn 屏幕保护程序文件)
  4. 它应该在控制面板 -> 添加或删除程序"中添加卸载该特定文件的选项,但不创建任何新条目 C:Program Files 或在某处复制卸载程序.exe.
  1. it should be a single exe file
  2. it should be robust (i.e. the technique should be known to work well on any Windows system)
  3. it should create only a single file (a .scn screensaver file) in %systemroot%
  4. it should add the option to uninstall that particular file in "Control Panel -> Add or Remove Programs" but without creating any new entry C:Program Files or copying an uninstaller.exe somewhere.

我见过这样工作的安装程序 - 那么如何做到这一点?

I've seen installers that work like that - so how to do this?

推荐答案

正如你所说的,它可以是一个 MSI,我建议走这条路.

As you've said it can be an MSI, I'd suggest going down that route.

您可以在 Visual Studio 中尝试安装程序项目(如果有的话;我不确定 Express 版本是否支持制作安装程序),因为它们会很高兴地生成一个 MSI 来满足您的要求.值得注意的是,他们会生成一个 EXE 和一个 MSI,不过您只需要分发 MSI.

You could play around with installer projects in Visual Studio (if you have it; I'm not sure if the Express editions support making installers), as they'll quite happily produce an MSI that will do what you're asking. It's worth noting they'll produce an EXE and an MSI, you only need to distribute the MSI though.

如果没有,请查看 Windows Installer XML (WiX),因为它可以让您手工雕刻一个MSI 完全按照您的意愿行事,并将满足您的上述所有五点要求.

Failing that, take a look at Windows Installer XML (WiX) as that will let you hand sculpt an MSI that does exactly what you want it to do and will cater for all five of your points above.

注意:使用 MSI 意味着您需要在要安装到的计算机上安装 Windows Installer - 从 Windows 2000/ME 开始,它是内置的.

Note: Using an MSI will mean that you'll need to have Windows Installer on the machine you're installing to - It's in-box from Windows 2000/ME upwards.

这篇关于如何为 Windows 创建一个强大的、最小的安装程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆