ipen Posted May 9, 2012 Posted May 9, 2012 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 !
Geej Posted May 10, 2012 Posted May 10, 2012 I dun really know, just try rename MCTSFXConfig.txt to config.txt Cheers!
myselfidem Posted May 20, 2012 Posted May 20, 2012 (edited) You can try to use 7zsd.sfx ! And check if your config.txt is saved in UTF-8 encoding:DownloadsCreate 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 May 20, 2012 by myselfidem
myselfidem Posted May 22, 2012 Posted May 22, 2012 (edited) 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! Edited May 22, 2012 by myselfidem
jaclaz Posted May 22, 2012 Posted May 22, 2012 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/forums//index.php?showtopic=18845&hl=http://reboot.pro/628/http://www.911cd.net/forums//index.php?showtopic=21123jaclaz
submix8c Posted May 24, 2012 Posted May 24, 2012 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 formatThis 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...)
ipen Posted May 30, 2012 Author Posted May 30, 2012 Yep - the 'setup.exe' works just fine on both OS.Only when using the SFX - it fails on XP.
ipen Posted May 30, 2012 Author Posted May 30, 2012 (edited) 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 May 30, 2012 by ipen
bphlpt Posted May 30, 2012 Posted May 30, 2012 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
myselfidem Posted May 30, 2012 Posted May 30, 2012 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?
submix8c Posted May 31, 2012 Posted May 31, 2012 (edited) 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!!!! Edited May 31, 2012 by submix8c
ipen Posted June 6, 2012 Author Posted June 6, 2012 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 ?ThanksIris
submix8c Posted June 6, 2012 Posted June 6, 2012 (edited) 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 commandcopy /-Y /B 7zsd.sfx+config.txt+notepad.7z 7ztest.exe4 - 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 June 6, 2012 by submix8c
myselfidem Posted June 6, 2012 Posted June 6, 2012 (edited) It's not the best way to create your SFX file inside the folder: C:\Program Files\7-ZipBut, if you need for both architecture: 32-bit and 64-bit you need to use 7zsd_All.sfx moduleAll 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 offif 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"pauseScan3970.txt;!@Install@!UTF-8!; Mode silencieux pour HP Scanjet3970 series x86GUIMode="2"RunProgram="hidcon:cmd /c xcopy \"%%T\\*.*\" %SYSTEMDRIVE%\\Drivers\\Scanjet\\ /s /e /i /y"RunProgram="%SYSTEMDRIVE%\\Drivers\\Scanjet\\DPInst32.exe /SW";!@InstallEnd@!Output result7-Zip 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18ScanningCreating archive C:\Program Files\7-Zip\Scan3970.7zCompressing installdrvs.cmdCompressing DPInst.xmlCompressing DPInst.txtCompressing hpgt3970.catCompressing hpgt3970.infCompressing DPInst32.exeCompressing DPInst64.exeCompressing DPInstLaunch.exeCompressing hp3970co.dllCompressing x64\hp3970co.dllCompressing hpgt3970.dllCompressing x64\hpgt3970.dllCompressing hpst3970.dllCompressing hpxp3970.dllCompressing x64\hpxp3970.dllCompressing hpusbscn.sysEverything is OkC:\Program Files\7-Zip\7zsd.sfxC:\Program Files\7-Zip\Scan3970.txtC:\Program Files\7-Zip\Scan3970.7z 1 fichier(s) copié(s).Appuyez sur une touche pour continuer...*Edit: Tested also on XP and works fine!It seems with Windows XP, there is an subfolder inside your temp folder!HTH Edited June 16, 2012 by myselfidem
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now