Why does 7zip Ignore my InstallPath when making a SFX installer?
Asked Answered
R

2

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?

Roof answered 2/4, 2010 at 20:9 Comment(0)
T
9

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

Tinned answered 14/7, 2012 at 7:1 Comment(5)
Thanks! Marking this one instead of my own.Roof
THANK YOU!!! This helped me get around some nastiness that my company's anti-virus program was causing my installer.Misquote
I had success with the 7zSD (7zsd_All.sfx) package from 7zsfx.info/en as well, if the link above doesn't work.Maulstick
(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. The rest of the archived file downloads are here, or you can browse an archived version of the site such as here. continued...Airsickness
(2/2) Additionally, I found this program 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.Airsickness
R
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.

Roof answered 6/4, 2010 at 16:59 Comment(4)
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.Octaviooctavius
but it was posted by the OP !Buehler
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: "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."Airsickness
Also downvoted bc it does not provide an code - just opinion.Tyrus

© 2022 - 2024 — McMap. All rights reserved.