9

Currently, I am making a SFX with 7zip using the following config:

;!@Install@!UTF-8!
InstallPath="C:\\test"
GUIMode="2"
RunProgram="7z465.exe"
;!@InstallEnd@!

I then package 7z465.exe into Setup.7z, and then call the following line in a batch file:

copy /b "C:\Program Files\7-Zip\7zSD.sfx" + config.txt + ".\Release\Setup.7z" .\Release\Setup.exe

When I run the resulting Setup.exe, It extracts fine and launches the 7z465.exe as well, but it is still extracting to some 7zip temp folder for the current user and not C:\test!

Running as administrator seems to have no effect either.

Anyone have any idea why this is happening?

Ben
  • 7,692
  • 15
  • 49
  • 64

2 Answers2

9

Use modified 7zsd.sfx from http://7zsfx.solta.ru. InstallPath only works with the modified package.

mikesl
  • 2,133
  • 20
  • 25
  • Thanks! Marking this one instead of my own. – Ben Sep 10 '12 at 19:19
  • THANK YOU!!! This helped me get around some nastiness that my company's anti-virus program was causing my installer. – Brad Bruce May 16 '14 at 12:59
  • I had success with the 7zSD (7zsd_All.sfx) package from http://www.7zsfx.info/en/ as well, if the link above doesn't work. – iank Aug 26 '16 at 16:52
  • 2
    (1/2) For people from the future: 7zsfx.solta.ru and 7zsfx.info are both gone. I've had some luck with archive.org's backups. The most recent working version I've found is `7zsd_All.sfx` in [this archive](https://web.archive.org/web/20160403000431/http://7zsfx.info/files/7zsd_extra_160_3873.7z). The rest of the archived file downloads are [here](https://web.archive.org/web/*/http://7zsfx.info:80/files/*), or you can browse an archived version of the site such as [here](https://web.archive.org/web/20120213233851/http://7zsfx.info/en/). continued... – starwarswii Jul 13 '17 at 18:38
  • (2/2) Additionally, I found [this program](https://sourceforge.net/projects/s-zipsfxbuilder/) pretty helpful for creating the configs, and it also comes packaged with some versions of the modified sfx files located in `C:\Program Files (x86)\7z SFX Builder\3rdParty\Modules` once you install it. – starwarswii Jul 13 '17 at 18:39
0

I never found out why this was happening, and after hours of struggling with it, I switched to WinRAR. Granted, its got some quirks of its own, but I was at least able to figure those out and get it running for my needs.

Would recommend WinRAR over 7z for SFX stuff.

Ben
  • 7,692
  • 15
  • 49
  • 64
  • 1
    While I agree with you that WinRAR was much easier to get to work than 7zip, I downvoted this answer because it did not address the OP's original question. – Michael Hohlios May 09 '12 at 14:47
  • 1
    but it was posted by the OP ! – Paul Taylor Jan 12 '15 at 14:28
  • WinRAR is much easier to create SFX installers with. Note however that you must purchase a licence if you intend to distribute the installers commercially. See item 7 in the [WinRAR Licence](http://www.win-rar.com/winrarlicense.html): "There are no additional license fees, apart from the cost of the license, associated with the creation and distribution of RAR archives, volumes, self-extracting archives or self-extracting volumes." – starwarswii Jul 13 '17 at 20:37
  • Also downvoted bc it does not provide an code - just opinion. – ankostis May 02 '18 at 20:13