Menu

Self Extracting Installer Help

2012-01-10
2012-12-07
  • Denzil Dexter

    Denzil Dexter - 2012-01-10

    Hi,
    I've been trying to use 7zip to create a self extracting installer and am having the following snags.  I create the archive and exe as follows:

    7z.exe a -r AppSetup.7z .\Release\*.*
    copy /b .\7zS.sfx + .\config.txt + .\AppSetup.7z AppSetup.exe
    

    The config file looks like:

    ;!@Install@!UTF-8!
    Title="My Software"
    RunProgram="setup.exe"
    ;!@InstallEnd@!
    

    Anyway, the Release folder contains the output of a Visual Studio 2008 Installer project.  When I create my installer project with the Visual Studio option 'In setup file' then I get setup.exe and app.msi in the Release directory and the self extracting archive works.  If however I create the installer as 'as loose uncompressed files' then the self extracting exe only seems to extract setup.exe and app.msi to the temp folder and the install then fails.

    Is this a limitation of 7-Zip SFX? Must the installer just contain setup.exe and the msi? For reasons I won't go into here I'd prefer to keep my installer as loose uncompressed files.

    Any help appreciated.
    DD

     
  • jose_chingasos

    jose_chingasos - 2012-01-10

    In your command, change source from:
    .\Release\*.*

    To:
    .\Release\*

    This is mentioned in the 7-zip CHM, under "Command Line Syntax"

     
  • Denzil Dexter

    Denzil Dexter - 2012-01-11

    Well I'll give that a try BUT *.* is equivalent to * on Windows and so IMO this is unlikely to work.  If I extract my file using the 7zip GUI the archive is complete and so it's not a problem with archive creation. It seems to be a problem with archive extraction when using SFX. 
    Any other suggestions in the meantime?
    Thanks, DD

     
  • Igor Pavlov

    Igor Pavlov - 2012-01-11

    Maybe there is switch for setup.exe that keeps setup.exe running during msi installation.

     
  • Denzil Dexter

    Denzil Dexter - 2012-01-12

    Thanks for the suggestions but I guess I'm not making myself clear.  Here's a second attempt at explaining what seems to be happening:
    The Visual Studio installer is built as loose files so in the Release folder there is:
    setup.exe
    app.msi
    Windows folder
    lots of other files and folders needed for install

    I build the 7z archive and exe as per previous posts and if I extract these through the 7zip GUI all the content is present and correct.  IF HOWEVER I simply run the exe (self extracting) then in the %TEMP% directory I only get setup.exe, app.msi and a Windows folder - the other files do not seem to get extracted.  I'm confused as to why?

    Regards,
    DD

     
  • Igor Pavlov

    Igor Pavlov - 2012-01-12

    Probably 7-Zip thinks that installation was finished, when .exe was finished. So it removes temp files.
    To keep files, check the switch that keeps setup.exe running.

     
  • Denzil Dexter

    Denzil Dexter - 2012-01-12

    Thanks Igor,
    That does indeed appear to be the problem.  Setup.exe launces the MSI and quits, the SFX then deletes the content of %TEMP% so the msi fails.  To fix it I modified the config as follows as I couldn't find a switch to keep setup.exe alive:

    ;!@Install@!UTF-8!
    Title="My Application"
    ExecuteFile="msiexec.exe"
    ExecuteParameters="/i app.msi"
    ;!@InstallEnd@!
    

    Thanks again,
    DD

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.