Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

7z Self extracting

- - - - -

  • Please log in to reply
37 replies to this topic

#1
ipen

ipen

    Newbie

  • Member
  • 11 posts
  • OS:XP Pro x86
  • Country: Country Flag
Hello all,
I been trying to create a self extracting zip (SFX) to contain my installation folder.
I am using 7z modules like "7zs.Sfx" or "7zSD_Lzma.sfx".

I created a zip which after extraction run the "setup.exe" .
this is the command lines in the batch file :

"C:\Program Files\7-Zip\7z.exe" a %zipFileName% %allFromOutputDir% (creating a 7z zip)
copy /b "C:\Program Files\7-Zip\7zS.sfx" -y + MCTSFXConfig.txt + %zipFileName% %outputFile% (Creating self extracting zip)


this is the config content :

;!@Install@!UTF-8!
RunProgram="setup.exe"
GUIMode="2"
;!@InstallEnd@!


On my comuter which OC is win7 - it works good!
But when i try to run it on WinXP pro x86
i get this error after extraction :
"This installation package could not be opened..."

So i tried different command for SFX :

"C:\Program Files\7-Zip\7z.exe" a %zipFileName% %allFromOutputDir%
copy /b "C:\Program Files\7-Zip\7zSD_LZMA.sfx" + MCTSFXConfig.txt + %zipFileName% %outputFile%

and when i am trying to run its out put - i get this error :

"Could not read configuration or configuration not found".
NOTE : it is the same configuration...

Please help !


How to remove advertisement from MSFN

#2
Geej

Geej

    Senior Member

  • Member
  • PipPipPipPip
  • 635 posts
  • OS:XP Pro x86
  • Country: Country Flag
I dun really know, just try rename MCTSFXConfig.txt to config.txt

Cheers!

#3
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • OS:Windows 7 x64
  • Country: Country Flag
You can try to use 7zsd.sfx ! And check if your config.txt is saved in UTF-8 encoding:

Downloads

Create your batch file config.bat inside your folder location and after you created the archive with 7zip, launch the batch file, to create the exe file:

config.bat (example for folder.exe, using 7zsd.sfx module)
@copy /b 7zsd.sfx + config.txt + folder.7z folder.exe

Edited by myselfidem, 20 May 2012 - 01:34 PM.

For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).

#4
ipen

ipen

    Newbie

  • Member
  • 11 posts
  • OS:XP Pro x86
  • Country: Country Flag
Hi,
Tried all that - did not work...
Thanks
Iris

#5
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • OS:Windows 7 x64
  • Country: Country Flag

I created a zip which after extraction run the "setup.exe" .
this is the command lines in the batch file :

"C:\Program Files\7-Zip\7z.exe" a %zipFileName% %allFromOutputDir% (creating a 7z zip)
copy /b "C:\Program Files\7-Zip\7zS.sfx" -y + MCTSFXConfig.txt + %zipFileName% %outputFile% (Creating self extracting zip)

Where did you found this method? Strange! :blink:

Edited by myselfidem, 22 May 2012 - 04:43 AM.

For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).

#6
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,043 posts
  • OS:none specified
  • Country: Country Flag
I can assure that 7-zip selfextractor do normally work on 2K and XP.
Casbah and it's predecessors make use of a similar approach, and have worked allright since a few years, so what you report is strange:
http://reboot.pro/4023/
maybe you can find something that has been overlooked by comparing what you do with the contents of the "historical threads":
http://www.911cd.net...topic=18845&hl=
http://reboot.pro/628/
http://www.911cd.net...showtopic=21123

jaclaz

#7
submix8c

submix8c

    Inconceivable!

  • Patrons
  • 4,193 posts
  • OS:none specified
  • Country: Country Flag
Hmmm... one would assume the CONFIG.TXT is as follows -

7zSD.sfx Windows version for installers (uses MSVCRT.dll).

(using the one linked to by myselfidem...)

Installer Config file format
This config file contains commands for the Installer. The file begins with the string ;!@Install@!UTF-8! and ends with ;!@InstallEnd@!. The file must be written in UTF-8 encoding.

This "setup.exe' is compatible with both OS', right? (you never even said what it is / where it's from...)

Someday the tyrants will be unthroned... Jason "Jay" Chasteen; RIP, bro!

Posted Image


#8
ipen

ipen

    Newbie

  • Member
  • 11 posts
  • OS:XP Pro x86
  • Country: Country Flag
Yep - the 'setup.exe' works just fine on both OS.
Only when using the SFX - it fails on XP.

#9
ipen

ipen

    Newbie

  • Member
  • 11 posts
  • OS:XP Pro x86
  • Country: Country Flag
Hi,
Tried all the above - still same errors.
I have a VS.net setup project - creating my setup.exe file.
Then i have a post build event - trying to create the SFX like this :

"C:\Program Files\7-Zip\7z.exe" a %zipFileName% %allFromOutputDir%
copy /b "C:\Program Files\7-Zip\7zS.sfx" + config.txt + %zipFileName% %outputFile%


When running its product - it cause this error :
"This installation package could not be opened..."


or like this

"C:\Program Files\7-Zip\7z.exe" a %zipFileName% %allFromOutputDir%
copy /b "C:\Program Files\7-Zip\7zSD_LZMA.sfx" + config.txt + %zipFileName% %outputFile%


When running its product - it cause this error :
"Could not read configuration or configuration not found".

config file is saved in UTF-8 encoding.

NOTE : both errors only happen on win XP .
On win 7 - it works great!!!

Any other suggestions ?

Edited by ipen, 30 May 2012 - 05:13 AM.


#10
bphlpt

bphlpt

    MSFN Addict

  • Member
  • PipPipPipPipPipPipPip
  • 1,796 posts
  • OS:none specified
  • Country: Country Flag
Are all apps involved, both the ones you make and the tools used to make them, all 32 bit apps? No 64 bit apps are there? Are both your installations of XP and Win7 32 bit versions?

Cheers and Regards

Posted Image


#11
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • OS:Windows 7 x64
  • Country: Country Flag

Tried all the above - still same errors.
I have a VS.net setup project - creating my setup.exe file.


Maybe you need to check if your VS.net creating your customized setup.exe is compatible with Windows XP?
For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).

#12
submix8c

submix8c

    Inconceivable!

  • Patrons
  • 4,193 posts
  • OS:none specified
  • Country: Country Flag

I have a VS.net setup project - creating my setup.exe file.

BWAHAHAHAH!!!! You need dotNET Runtime installed BEFORE running the Install App, I betcha!!!! Notice that that tiny little detail (the quote) was what you neglected to tell anyone.

XP does NOT install dotNet "by default", but... Win7 DOES!!!! :lol:

Edited by submix8c, 31 May 2012 - 05:15 PM.

Someday the tyrants will be unthroned... Jason "Jay" Chasteen; RIP, bro!

Posted Image


#13
ipen

ipen

    Newbie

  • Member
  • 11 posts
  • OS:XP Pro x86
  • Country: Country Flag
Look,
The setup alone does work on both OS... (XP and win 7).

Only after creating SFX and using it - it does not work on win XP.
And yes - the setup pre-requisite is to install .net frame work.

Any other suggestions ?
Thanks
Iris

#14
submix8c

submix8c

    Inconceivable!

  • Patrons
  • 4,193 posts
  • OS:none specified
  • Country: Country Flag
YES!!!!!

Riddle me this, Batman!

WHAT is the ACTUAL value of variable
%allFromOutputDir%

This may help, since this is CREATED on Win7...

edit - AMAZING!!!!!
1 - I first 7-zipped notepad.exe (JUST THAT and NOT the Folder)
2 - I then created a config.txt EXACTLY like yours (changed pgm to NOTEPAD.EXE)
3 - I then ran this command
copy /-Y /B 7zsd.sfx+config.txt+notepad.7z 7ztest.exe
4 - I then double-clicked 7ztest.exe - NOTEPAD OPENED!!!

Dude, you are doing something WRONG!!!! See MY "copy" command! YES, it DOES work!

Please note I used this one...

Edited by submix8c, 06 June 2012 - 09:26 AM.

Someday the tyrants will be unthroned... Jason "Jay" Chasteen; RIP, bro!

Posted Image


#15
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • OS:Windows 7 x64
  • Country: Country Flag
It's not the best way to create your SFX file inside the folder: C:\Program Files\7-Zip

But, if you need for both architecture: 32-bit and 64-bit you need to use 7zsd_All.sfx module

All module versions (7zSD) for installers use MSVCRT.dll (Microsoft Visual C runtime library). In other words, some functions are performed via this dynamic library, and this helps reduce the module size. This file is present in all operating systems supported by the module. Old module versions (7zS) that did not require MSVCRT.dll are no longer supported.


I create an SFX file inside this folder for Scanjet 3970 series drivers (as example), like this:

config.bat
@echo off
if exist "%~dp0Scan3970.7z" del /f /q "%~dp0Scan3970.7z"
echo.
cd "%~dp0Scan3970"
"%~dp07z.exe" a -t7z -mx9 -y "%~dp0Scan3970"
@copy /b /y "%~dp07zsd.sfx" + "%~dp0Scan3970.txt" + "%~dp0Scan3970.7z" "%~dp0Scan3970.exe"
pause

Scan3970.txt
;!@Install@!UTF-8!
; Mode silencieux pour HP Scanjet3970 series x86
GUIMode="2"
RunProgram="hidcon:cmd /c xcopy \"%%T\\*.*\" %SYSTEMDRIVE%\\Drivers\\Scanjet\\ /s /e /i /y"
RunProgram="%SYSTEMDRIVE%\\Drivers\\Scanjet\\DPInst32.exe /SW"
;!@InstallEnd@!

Output result
Spoiler


*Edit:
Tested also on XP and works fine!
It seems with Windows XP, there is an subfolder inside your temp folder!
HTH

Edited by myselfidem, 16 June 2012 - 01:46 PM.

For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).

#16
ipen

ipen

    Newbie

  • Member
  • 11 posts
  • OS:XP Pro x86
  • Country: Country Flag
Hi,
Well let me better explain :


"C:\Program Files\7-Zip\7z.exe" a %zipFileName% %allFromOutputDir%
copy /b "C:\Program Files\7-Zip\7zSD_LZMA.sfx" + config.txt + %zipFileName% %outputFile%

where :
%zipFileName% = "MySetup.7z"
%allFromOutputDir% = all of the items that currentlly exists in the output dir of the setup project. (bin\release\...)
%outputFile% = "MySFX.exe"

thats it...
Did not zip only one file but the whole setup dir - since the setup my contain more then just the ".exe".
It contains the pre- requisites folders (like the .net version and win intsller etc.).
That is not the issue.
I will try your format of command :
copy /-Y /B

#17
ipen

ipen

    Newbie

  • Member
  • 11 posts
  • OS:XP Pro x86
  • Country: Country Flag
Hi,
tried both of the last suggestions....
Still same errors.
Could it be because my zip contains more then one file ?
See , the zip contains these items :
- MySetup.msi
- setup.exe
- "WindowsInstaller3_1" folder (pre - requisite)
-"DotNetFX35" folder (another pre-requisite)

Now - when i run my SFX on win XP - it does run the "setup.exe", but after checking for the pre-requisites , it fails to run the MSI !!!
Here is the log content :


The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [ProcessorArchitecture] = Intel {string}
Property: [VersionNT] = 5.1.3 {version}
Running checks for package 'Windows Installer 3.1', phase BuildList
The following properties have been set for package 'Windows Installer 3.1':
Running checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.1': true
Result of checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
'Windows Installer 3.1' RunCheck result: No Install Needed
Running checks for package '.NET Framework 3.5', phase BuildList
Reading value 'Install' of registry key 'HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5\1033'
Read integer value 1
Setting value '1 {int}' for property 'DotNet35InstallSuccess'
The following properties have been set for package '.NET Framework 3.5':
Property: [DotNet35InstallSuccess] = 1 {int}
Running checks for command 'DotNetFX35\dotNetFx35setup.exe'
Result of running operator 'ValueEqualTo' on property 'DotNet35InstallSuccess' and value '1': true
Result of checks for command 'DotNetFX35\dotNetFx35setup.exe' is 'Bypass'
'.NET Framework 3.5' RunCheck result: No Install Needed
Launching Application.
Running command 'C:\WINDOWS\system32\msiexec.exe' with arguments ' -I "C:\DOCUME~1\...\LOCALS~1\Temp\7zS909.tmp\MySetup.msi" '



Any ideas ?

Edited by ipen, 10 June 2012 - 02:24 AM.


#18
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • OS:Windows 7 x64
  • Country: Country Flag
You mean this time works on Windows 7 but not on Windows XP?

Maybe you can try to change the config.txt

;!@Install@!UTF-8!
GUIMode="2"
RunProgram="Setup.exe"
RunProgram="MySetup.msi /qn"
;!@InstallEnd@!


*Edit:
It seems you have add an argument with a temp folder : 7zS909.tmp inside your msi file! and the path isn't correct.

Launching Application.
Running command 'C:\WINDOWS\system32\msiexec.exe' with arguments ' -I "C:\DOCUME~1\...\LOCALS~1\Temp\7zS909.tmp\MySetup.msi" '


Edited by myselfidem, 10 June 2012 - 03:33 AM.

For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).

#19
Oleg_Sch

Oleg_Sch

    Newbie

  • Member
  • 34 posts
Original SFX module don't support multiple RunProgram. What module are you use? From 7-zip.org or from 7zsfx.info? As I see, you must use modified modules from http://7zsfx.info

#20
ipen

ipen

    Newbie

  • Member
  • 11 posts
  • OS:XP Pro x86
  • Country: Country Flag
Hi,
I use "7zsd.sfx" from 7zsd_tools_150_2100.exe
Is it the correct version for my needs ?
- run self extructed installer
- run on win XP and win 7

???
Thanks

#21
ipen

ipen

    Newbie

  • Member
  • 11 posts
  • OS:XP Pro x86
  • Country: Country Flag
when using the "7zsd.sfx" from

7zSD
1.5 beta (build 2478)
May 10, 2012
Modified 32-bit module (for LZMA compression method that 7-Zip uses by default).
(downloaded from 7-zip.info)


and trying to run it product - it gives me an error "Could not read SFX configuration or configuration Not found".

When using "7zsd.sfx" from 7z920_extra (downloaded from 7-zip.org) it works but only on win7.

when using "7zsd.sfx" from 7zSD 1.4.3 Release (build 2367) January 21, 2012 (downloaded from 7-zip.info)
it still gives me this
"Could not read SFX configuration or configuration Not found"

Please help!

#22
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • OS:Windows 7 x64
  • Country: Country Flag
Maybe you need to install Windows Installer 4.5 for Windows XP, for your "MySetup.msi" file?:

Windows Installer 4.5

http://en.wikipedia....ndows_Installer

Edited by myselfidem, 13 June 2012 - 09:27 AM.

For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).

#23
submix8c

submix8c

    Inconceivable!

  • Patrons
  • 4,193 posts
  • OS:none specified
  • Country: Country Flag
That's what we have been TRYING to tell you all along!

Modified 32-bit module (for LZMA compression method that 7-Zip uses by default).

..and as far as the OTHER one mentioned

(myselfidem said) But, if you need for both architecture: 32-bit and 64-bit you need to use 7zsd_All.sfx module

Not really... The set you are getting contains 2 help files and "7zsplit" - the remainder are EXACTLY like the "Extra" package. Read this -

Contains 12 modified modules (six 32-bit modules and six 64-bit ones). There is a separate module for each compression method (LZMA, LZMA2, Deflate, PPMd), as well as universal modules that support any of these methods. Additionally, there are modules with extra dialogs and a banner.

In other words, there is SPECIFICALLY an x86 and an x64 version. "All" means ALL methods (EITHER an x86 OR x64). The "Basic" one (first download "7zsd") is EXACTLY "7zsd_LZMA.sfx" that's inside the package. THAT one is JUST 32-bit for LZMA method (which you have been TRYING to do). The "Tools" one is just the COMPLETE package, OK???

...and do the Create of the SFX.EXE the way I showed you (the "copy" command).

Can I assume that your Windows7 AND WindowsXP are BOTH x86???

edit - In MY example, I used the BETA version from the link given to you. AND the suggestion given above MIGHT be your problem! You MUST use the CORRECT MSIEXEC for the METHOD YOU BUILT THE MSI PACKAGE!!!! You CANNOT build an MSI with a NEWER version and Install it using an OLDER MSIEXEC!

note: use the "7zsplit" program on your "built" EXE - see if you REALLY have it built correctly. Again, Works fine for me (x86)...

Edited by submix8c, 13 June 2012 - 10:15 AM.

Someday the tyrants will be unthroned... Jason "Jay" Chasteen; RIP, bro!

Posted Image


#24
ipen

ipen

    Newbie

  • Member
  • 11 posts
  • OS:XP Pro x86
  • Country: Country Flag
Yes - the commad i use is exactlly like yours.

I tried installing Windows Installer 4.5. Did not help.

Can you please just post the link to what you think is the relevant SFX version - because i am very confused by now...

#25
submix8c

submix8c

    Inconceivable!

  • Patrons
  • 4,193 posts
  • OS:none specified
  • Country: Country Flag
"C:\Program Files\7-Zip\7z.exe" a %zipFileName% %allFromOutputDir%
copy /b "C:\Program Files\7-Zip\7zSD_LZMA.sfx" + config.txt + %zipFileName% %outputFile%

where :
%zipFileName% = "MySetup.7z"
%allFromOutputDir% = all of the items that currently exists in the output dir of the setup project. (bin\release\...)
%outputFile% = "MySFX.exe"

this is the config content :
;!@Install@!UTF-8!
RunProgram="setup.exe"
GUIMode="2"
;!@InstallEnd@!

Contents of %allFromOutputDir% (after which the zip contains these items):
- setup.exe (OBVIOUSLY WRITTEN IN-HOUSE TO CHECK/INSTALL)
- "WindowsInstaller3_1" folder (pre - requisite)
--- WindowsInstaller-KB893803-v2-x86.exe (FILE WITHIN FOLDER!!!)
- "DotNetFX35" folder (another pre-requisite)
--- dotNetFx35setup.exe (FILE WITHIN FOLDER!!!)
- MySetup.msi (NOT WITHIN A FOLDER!!!)
===== The Actual SFX Execution =====
<snip>
Running checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe'
<snip>
Running checks for command 'DotNetFX35\dotNetFx35setup.exe'
(My Note: This is the Bootstrapper and NOT the "Full", correct?)
(http://www.careerrid...pplication.aspx)
<snip>
Launching Application.
Running command 'C:\WINDOWS\system32\msiexec.exe' with arguments ' -I "C:\DOCUME~1\...\LOCALS~1\Temp\7zS909.tmp\MySetup.msi" '
-----
Result (according to Your Notes):
"This installation package could not be opened..."
(My Note: OBVIOUSLY a result of NOT FINDING THE MSI FILE!)
(My Note: You APPARENTLY have used "\...\" to keep us from seeing UserID?)
-OR-
"Could not read configuration or configuration not found".
(My Note: OBVIOUSLY because CONFIG.TXT is NOT properly included!)
===== Your Comments on Failures =====
The setup alone does work on both OS... (XP and win 7).

Only after creating SFX and using it - it does not work on win XP.
And yes - the setup pre-requisite is to install .net frame work.
(My Note - Your are programmatically checking MS-Installer+DotNET)

On my comuter which OC is win7 - it works good!
(My Note: You are referring to the SFX Install.)
But when i try to run it on WinXP pro x86
i get this error after extraction :
"This installation package could not be opened..."
===== From 7-Zip ORG files =====
Failure #1 -
create the SFX like this :
"C:\Program Files\7-Zip\7z.exe" a %zipFileName% %allFromOutputDir%
copy /b "C:\Program Files\7-Zip\7zS.sfx" + config.txt + %zipFileName% %outputFile%
When running its product - it cause this error :
"This installation package could not be opened..."

Failure #2 -
or like this
"C:\Program Files\7-Zip\7z.exe" a %zipFileName% %allFromOutputDir%
copy /b "C:\Program Files\7-Zip\7zSD_LZMA.sfx" + config.txt + %zipFileName% %outputFile%
When running its product - it cause this error :
"Could not read configuration or configuration not found".

Failure #3 -

I use "7zsd.sfx" from 7zsd_tools_150_2100.exe
Is it the correct version for my needs ?
- run self extructed installer
- run on win XP and win 7

when using the "7zsd.sfx" from

7zSD
1.5 beta (build 2478)
May 10, 2012
Modified 32-bit module (for LZMA compression method that 7-Zip uses by default). (downloaded from 7-zip.info)

and trying to run it product - it gives me an error "Could not read SFX configuration or configuration Not found".

When using "7zsd.sfx" from 7z920_extra (downloaded from 7-zip.org) it works but only on win7.

when using "7zsd.sfx" from 7zSD 1.4.3 Release (build 2367) January 21, 2012 (downloaded from 7-zip.info)
it still gives me this
"Could not read SFX configuration or configuration Not found"

Please help!

1 - DO NOT USE THAT ONE!!! USE THE FIRST ONE (the BETA one!!!)
2 - OR DON'T USE IT, BUT USE THE 7-ZIP ORG ONE
3 - PLEASE NOTE! MSIEXEC CANNOT FIND THE MSI!!!
3a - TRY to put it in a SUBFOLDER and see if that works
3b - NOTE that when you RUN the MSIinstaller AND/OR the DotNETinstaller that they CREATE A TEMP FOLDER ON THE ROOT OF THE LARGEST FREE-SPACE DRIVE!
Your Application is NOT doing that! It is INVOKING the MSIEXEC.EXE Program!
The question is... IS YOUR SETUP.EXE CORRECTLY PASSING THE PATH TO THE MSI FILE???
-To test this - WHEN it Fails with "This installation package could not be opened..." NAVIGATE in EXPLORER to the TEMP folder and SEE IF IT IS INDEED THERE!

Bottom Line - We have NO CLUE how you CREATED the SETUP.EXE PROJECT!!!
(My Note - MAYBE you need to use DOUBLE-QUOTES?)

Go BACK here and read CLOSELY the "Configuration Parameters" section. YOU NEED TO CORRECTLY PASS THE PATH TO THE MSI! PERIOD!!! FORCE it to "somewhere"!!!

Edited by submix8c, 14 June 2012 - 08:42 AM.

Someday the tyrants will be unthroned... Jason "Jay" Chasteen; RIP, bro!

Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN