可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I want to create an installer EXE with some specific properties:
- it should be a single exe file
- it should be robust (i.e. the technique should be known to work well on any Windows system)
- it should create only a single file (a .scn screensaver file) in %systemroot%
- 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?
回答1:
As you've said it can be an MSI, I'd suggest going down that route.
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.
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.
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.
回答2:
Take a look at NSIS it is quite simple and it is used to create installers for Windows.
回答3:
I've heard good things about the free installer Innosetup, and the website says it can create single EXE installs.
回答4:
Try Advanced Installer, I think it can do all that you ask. I use it for slightly more complex installers but the free version is easy to use and powerful.
There can be an issue with MSI files, older PCs don't have the latest Windows Installer, 3.1, so you need to install that or prompt the user to, first! Have you looked into using IExpress if you just want to copy a file across?
回答5:
Both NSIS and Inno Setup will cope with all the tasks specified. Inno Setup uses a Pascal-like language for its scripts, NSIS uses its own script language.
回答6:
NSIS is the way to go, very simple to learn, just write a simple file specifying which files you want to install over where. You can also add QuickLaunch options and so on. Then run the NSIS compiler and you get the exe.
回答7:
The not copying an installer somewhere and adding an entry into Add/Remove seem to be counteractive. My understanding is that add-remove programs neccesarily references a copy of the uninstaller that resides in a Windows directory (so it doesn't lose access to it).
Perhaps you could have the screensaver double as an uninstaller if you pass it some sort of command-line option. Then simply tell the msi that the uninstaller IS the screensaver (hence no unnecessary coping to some other directory.)
回答8:
IExpress
You can use Microsoft Windows's built in installer wizard called "Iexpress". To access that, open "Run", which is done by hitting Windows Key and R at the same time(WindowsKey+R). When you get in "Run", type in the little box "iexpress.exe". Then hit enter. You are there!
Notes: Only available on Microsoft Windows (Legit, and NonLegit)
Setup Explained:
Page 1
- Create a Self Extraction Directive file.
Makes a new installation file
- Create a Self Extraction Directive file.
Edits a .SED
file
Page 2 (Of Create a Self Extraction Directive file.)
- Look in the "Description" at the bottom
Page 3
- Package Title
The name of your installer, as displayed at the top
Page 4
- Confirmation Prompt
What to tell the user before installing
Page 5
- License Agreement
Skip if you don't know what this is
Page 6
- Packaged Files
What files you need to install
Page 7
- Show Window
How the window is displayed
Page 8
- Displayed At Top
Page 9
- Package Names and Options
Where to save your File
- Hide File Extracting Progress From User
Hides the animation
- Store File using Long Name inside installer
Ignore if you don't know what this is
Page 10
- Displayed At Top
You are done!
Click on the Title to download the file, without doing those instructions. If it is a virus, got infected or you think it is a virus, feel free to delete the file.
回答9:
You can create a single installer file using just Visual Studio 2017 Pro and Windows in 3 steps:
- To have an entry in the Add/Remove Programs, you need to have a
setup project.
- The setup project may compile into 2 files: *.msi and
setup.exe
- To create a self-extracting package, you can use the
IExpress tool
回答10:
NSIS, MSI any installer can do that for you.
NSIS is pretty small and compact.
回答11:
If you want to use standard deployment methods with your installer you probably should stay away from NSIS. See http://unattended.sourceforge.net/installers.php for an overview.
回答12:
InstallShield has a release option called "Single .EXE". It can bundle the payload inside, plug register w/Add-Remove Programs as you specified.
回答13:
I'm using Actual Installer. Try it!