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

9

5

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.

Kendo answered 30/9, 2008 at 1:20 Comment(2)
I'm pretty sure you don't need the Setup.exe ... I usually just delete it and distribute the MSI by itself. :-)Roselba
I think the setup.exe checks for Windows Installer and such.. Perhaps I'm wrong though.Kendo
O
5

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.

Oversubtle answered 30/9, 2008 at 2:50 Comment(0)
A
11

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.

Allhallows answered 17/2, 2009 at 12:44 Comment(3)
Wow, I did not know of this tool's existence. Start -> run -> iexpress, for those who want to see it.Kendo
I knew @ the tools existence, but there were a few issues with the bootstrapper that comes with VS.Net 2008 that you had to work around. Couldn't be done in a scripted form from what I recall, sot it had little value unfortunately.Flawed
@Richard B: See this thread for solutions (i.e. workarounds) to that problem: social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/…Allhallows
O
5

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.

Oversubtle answered 30/9, 2008 at 2:50 Comment(0)
D
3

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.
Dinesen answered 30/9, 2008 at 2:46 Comment(2)
Has anyone integrated this with either an MSBuild scenario or a NAnt build scenario? This is a cool deal, but if it can't be put as part of the build process, then it's just that "cool", but not helpful.Flawed
If you have Setup.exe ready, MSIStuff.exe command can easily used with MSBuild using <Exec Command="msistuff.exe &quot;blah&quot;"/>. Did I misunderstand you?Dinesen
K
2

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
Kendo answered 30/9, 2008 at 5:8 Comment(0)
C
2

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.

Corbin answered 22/10, 2009 at 20:42 Comment(0)
S
1

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

Stannfield answered 30/9, 2008 at 1:35 Comment(1)
Inno Setup (Ver. 6.x - JRSoftware) and InnoScript (Kymoto - Ver. 2.x) both show that they have Viruses on virustotal.com. And when I package my distributable I get Viruses detected in my installation. I wrote to them both but they did not reply.Allynallys
G
1

nsis looks like a good choice

Goshorn answered 30/9, 2008 at 1:40 Comment(0)
R
1

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.

Roselba answered 30/9, 2008 at 1:58 Comment(0)
S
0

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

Skydive answered 27/1, 2010 at 22:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.