What is a good free utility to create a self-extracting executable with an embedded file version? [closed]

两盒软妹~` 提交于 2019-11-29 04:46:22

NSIS can do this.

Part of our build environment is a script that outputs version information to a "header" file that our NSIS script sources. You should be able to use something similar to embed your version information and you can certainly get NSIS to run a file after extraction.

In fact, as NSIS creates the installer package... you may be able to simplify your approach a great deal.

Dirk Vollmar

Little bit surprised that it is not listed here yet: IExpress is a simple tool coming with Windows and can be used to create self-extracting installers.

When you download Windows SDK, there is MSIStuff.exe and Setup.exe for which MS provides source code to compile. MSIStuff will "stuff" the MSI you give it into Setup.exe. Setup.exe can then be distributed.

More information at http://support.microsoft.com/kb/888473

Cons:

  • You'll have to recompile Setup.exe with the version of your product every time there is a new version of your product (MSI).
  • Not sure what license the Setup.exe source is distributed under.

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

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.

nsis looks like a good choice

try inno-setup

set the VersionInfoVersion directive to your binary version number, e.g.

VersionInfoVersion = 1.1.0.0

this will appear in mouseover text and properties

Ron Savage

Experiment in progress here:

Pop-up Version info: http://screencast.com/t/LVqvLfxCj3g

From Visual Studio Assembly info: http://screencast.com/t/fqunlMNh13

Installed with plain old MSI file.

By adding the "Version: 1.5.0" text into the Description property of the Setup Project, the version number also shows on the MSI file like so: http://screencast.com/t/A499i6jS

I generally just rename the MSI file, like DataMonkey_1_5_0.msi for my own purposes.

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).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!