7zip Self Extracting Archive (SFX) and .Net Installer

I am trying to create a self-extracting archive for a Windows application that I wrote. My application uses the latest .Net 4.0, and I want to include the .Net installation in the SFX installer. However, if the computer needs to install the .Net infrastructure and reboot, it will not properly resume installing my application. I looked at other sfx messages on Stack sites, but none of them is a problem with the .Net installer as a prerequisite for the application.

My project creates 4 files: "App Installer.msi" "setup.exe" "WindowsInstaller-KB893803-v2-x86.exe" (in the folder "WindowsInstaller3_1") and "dotNetFx40_Client_x86_x64.exe" (in the folder "DotNetFX40Client"), all of which I consider standard.

I use 7zip to create SFX as follows:

First use 7zip to compress all files into one archive:

7z.exe a -r AppInstallFiles.7z *

Then I make a binary copy with the 7zS.sfx file (used to create a self-extracting installer), my configuration file and archive. The configuration file is as follows:

;!@Install@!UTF-8!
Title="MyApp Installer"
ExecuteFile="setup.exe"
;!@InstallEnd@!

And I copy them using the line:

copy /b 7zS.sfx + config.txt + AppInstallFiles.7z MyAppInstaller.exe

, .NET 4.0 , .Net Framework - SFX, temp. , setup.exe , .Net 4.0, .Net Installer. temp . . "" . "" , : " MyApp" " " App Installer.msi

, , , .Net .Net, temp, My App, . setup.exe "App Installer.msi", , msi , .Net . , .

- .Net 7zip SFX, , ? 7zip, , .

+5
2

, SFX . , InstallPath:

;!@Install@!UTF-8!
Title="MyApp Installer"
ExecuteFile="setup.exe"
InstallPath="%temp%\\My App"
;!@InstallEnd@!

. MSI, .

PS. ,

+2

, . - , sfx temp , , setup.exe. temp temp :

::install.cmd, used to move the setup files to another directory before executing
xcopy /s * ..\MY_APP\
::use start to hide the cmd window
start ..\MY_APP\setup.exe

, . , , , , , .

+2

All Articles