What is a good free utility to create a self-extra

2019-01-24 16:13发布

According to the answers to this question, I cannot embed a file version in my .msi file.

The installer that I give the client needs to have a file version.

So, what I want to do is create a self-extracting executable containing the msi file and the setup.exe generated by Visual Studio, and put the file version on this self-extracting executable instead.

Therefore, I need a utility to create self-extracting executables which supports embedding a file version in its output. It also needs to support automatically running a file after extraction, so I can start the real installer automatically. It would be nice if it was scriptable.

All I could find was this, which looks great, but I would much prefer a free alternative.

Does anyone have any suggestions?

Edit: To clarify, I'm not really looking to create an installer - I already have a VS setup project. I just want a self-extractor (like WinZip can create). So, the user mouses over Setup-Blorgbeard2008.exe, sees "Version: 1.0.0.0". User doubleclicks it, it silently extracts setup.exe and setup.msi to a temp folder, then runs setup.exe. User then sees normal installer screen and proceeds as normal.

Another Edit: Yay, I don't need a self-extractor anymore, since my other question has now been answered. That makes this whole question pretty much irrelevant. It would still be nice to be able to distribute only one file, rather than setup.exe and setup.msi.

9条回答
欢心
2楼-- · 2019-01-24 16:34

I actually ended up using NSIS for this particular release, since I needed to bundle some other installers as well.

For reference, here's the script I used:

VIProductVersion              "1.0.0.0" ; set version here
VIAddVersionKey "FileVersion" "1.0.0.0" ; and here!
VIAddVersionKey "CompanyName" "MyCompany"
VIAddVersionKey "LegalCopyright" "© MyCompany"
VIAddVersionKey "FileDescription" "Installer for MyProgram"
OutFile MyProgram-Setup.exe

SilentInstall silent

Section Main    
    SetOutPath $TEMP
    SetOverwrite on
    File SharedManagementObjects.msi
    File SQLSysClrTypes.msi
    File Release\Setup.exe
    File Release\Setup.msi
    ExecWait 'msiexec /passive /i "$OUTDIR\SharedManagementObjects.msi"'
    ExecWait 'msiexec /passive /i "$OUTDIR\SQLSysClrTypes.msi"'
    Exec     '"$OUTDIR\Setup.exe"'
SectionEnd
查看更多
爷的心禁止访问
3楼-- · 2019-01-24 16:36

DotNetZip can produce a Self-Extracting archive, that includes a version number that shows up in a Windows Explorer mouseover. The SFX also includes a product name, description, product version, and copyright that shows up in a Properties/Details view in Windows Explorer.

The SFX can run a command that you specify after extract.

Creation of the SFX can be scripted from powershell, or you can write a program to do it, using VB.NET, C#, VBScript or JavaScript, etc.

To get the version number stuff, you need at least v1.9.0.26 of DotNetZip.

查看更多
Luminary・发光体
4楼-- · 2019-01-24 16:37

FYI using a DotNetZip self-extractor does not make sense if you are using the bootstrapper setup.exe to verify .NET is installed (DotNetZip self-extractor requires .NET 2.0).

查看更多
登录 后发表回答