odar Posted July 8, 2012 Share Posted July 8, 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)re:variabili"%ProgramFiles%\7-Zip\7z.exe" a -t7z "%zipFileName%" -oa "%allFromOutputDir%" (creating a 7z zip)copy /b "%programfiles%\7-Zip\7zS.sfx" -y + "MCTSFXConfig.txt "+ "%zipFileName%" "%outputFile%" (Creating self extracting zip)http://rapidgator.net/file/37500924/7zsfx_windows_XP_Vista_win7-32-64-MI.exe.htmlmoduli 7zsd + file.bat + reshaker + extraico + cmenuvideo tutorialhttp://youtu.be/fdRV6KzjQpU Edited August 31, 2012 by odar Link to comment Share on other sites More sharing options...
odar Posted July 8, 2012 Share Posted July 8, 2012 ;!@Install@!UTF-8!Title="7-Zip 4.00"BeginPrompt="Do you want to install the 7-Zip 4.00?"ExecuteFile="7zip.msi";!@InstallEnd@!;!@Install@!UTF-8!Title="7-Zip 4.01 Update"BeginPrompt="Do you want to install the 7-Zip 4.01 Update?"ExecuteFile="msiexec.exe"ExecuteParameters="/i 7zip.msi REINSTALL=ALL REINSTALLMODE=vomus";!@InstallEnd@!for file . msi---------------------------------------------bat file drag & drop----------------------------------------create a folder 7zsfx in %programfiles% in folder reshaker ,extraico,file bat create shortcut file bat in send to----------------------------------------------------file bat___________________________________________________--set pp=%1cd %programfiles%\7zsfx\temp"del /s/q "%programfiles%\7zsfx\temp" rd\\.\ "%programfiles%\7zsfx\temp" /s/qmd "%programfiles%\7zsfx\temp"rem --------------------------------------------@echo offclstitle creates sfx that executes a .bat file rem -----------------------------------------for /f "useback tokens=*" %%a in ('%pp%') do @set gff=%%~a%~d1cd "%~dp1"cd "%~f1"if [%errorlevel%] equ [1] @set fil=&goto parr echo compressing filecd..set fil=\**:parrecho %errorlevel% errorlevelset cuu=%cd%rem ----------------------------------------------------------------cls@echo .@echo ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±@echo ±± ±±@echo ±± creates sfx that executes a hidden .bat file ±±@echo ±± ±±@echo ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±@echo .rem ----------------------------------------------------------set /p as="select sfx name without extension :"set /p gtr="select file .bat to be executed afterwards :":passset bn=.7zset sd=.exeset cv=%as%%fv%%bn%set sx=%as%%fv%%sd%set sz=%as%%fv%set/a vb=%vb%+1set fv=_%vb%set co=%cl:~0,-4%set pr=%programfiles%set us=%username%set usp=%userprofile%set dc=.if exist "%~dp1%sx%" goto pass if exist "%~dp1%cv%" goto passecho creating %sx% wait....rem -------------------------------------------------rem ----------------------------------------------------------------echo ;!@Install@!UTF-8!>"%programfiles%\7zsfx\temp\configsfx.txt"echo InstallPath="%%temp%%\\%sz%">>"%programfiles%\7zsfx\temp\configsfx.txt"echo OverwriteMode="0">>"%programfiles%\7zsfx\temp\configsfx.txt"echo ExecuteFile="hidcon:%gtr%">>"%programfiles%\7zsfx\temp\configsfx.txt"echo GUiMode="2">>"%programfiles%\7zsfx\temp\configsfx.txt"echo Process="no">>"%programfiles%\7zsfx\temp\configsfx.txt"echo Delete="%%%%T">>"%programfiles%\7zsfx\temp\configsfx.txt"echo ;!@InstallEnd@!>>"%programfiles%\7zsfx\temp\configsfx.txt"rem ---------------------------------------------------------------start/wait "" "notepad.exe" ""%programfiles%\7zsfx\temp\configsfx.txt""copy "%programfiles%\7zsfx\temp\configsfx.txt" "%gff%" /v/yrem -----------------------------------------------------------------%~d1cd "%~dp1"7za a -t7z "%cv%" -oa "%gff%%fil%"echo %pp%%fil% compression finishedrem ----------------------------------------------------------------------------------------------------------------------------------echo copies %~dp1%cv% in %~dp1%sx%copy /b "%programfiles%\7zsfx\7Zsd2_all.sfx" + "%programfiles%\7zsfx\temp\configsfx.txt" + "%~dp1%cv%" "%~dp1%sx%"rem ----------------------------------------------------------del "%~dp1%cv%" /qrem ----------------------------------------------------------del /s/q "%programfiles%\7zsfx\temp" rd\\.\ "%programfiles%\7zsfx\temp" /s/qmd "%programfiles%\7zsfx\temp"rem extracts and inserts icons%~d1cd "%gff%"if exist "icon_1.ico" goto iconaif not exist "%gtr%" goto end %SYSTEMDRIVE%cd "%programfiles%\7zsfx"del "%programfiles%\7zsfx\reshacker_cambio_icona\*.*" /qextraico.exe -export -iconindex=1 -desttype=ICO -closewhendone "%gff%\%gtr%" "%programfiles%\7zsfx\reshacker_cambio_icona\icon_1.ico"cd "%programfiles%\7zsfx\reshacker_cambio_icona"if not exist "icon_1.ico" exitdir /w %programfiles%\7zsfx\reshacker_cambio_icona\icon_1.ico | find " 1 File 0 byte" if "%errorlevel%" == "0" (goto end)cd ..ResHacker.exe -addoverwrite "%~dp1%sx%", "%~dp1%sx%", "%programfiles%\7zsfx\reshacker_cambio_icona\icon_1.ico", ICONGROUP,MAINICON,0:endexit:icona%SYSTEMDRIVE%cd "%programfiles%\7zsfx"dir /w "%gff%\icon_1.ico" | find " 1 File 0 byte" if "%errorlevel%" == "0" (goto end)ResHacker.exe -addoverwrite "%~dp1%sx%", "%~dp1%sx%", "%gff%\icon_1.ico", ICONGROUP,MAINICON,0exit_______________________________ Link to comment Share on other sites More sharing options...
submix8c Posted July 8, 2012 Share Posted July 8, 2012 @odar - appreciate the detailed explanation of how you do it, except...The OP specifically states that the call to MSIEXEX is done from within a Visual Studio "SETUP.EXE" that they have compiled, which means the path given within the SETUP.EXE is not working.@ipen - have you considered trying to create an Install with something OTHER THAN a 7-zip? Link to comment Share on other sites More sharing options...
odar Posted July 8, 2012 Share Posted July 8, 2012 (edited) bat files are all contained in this sfx with installation of CMenu you create a context menu for easy operation of the module with 7zsd reshaker extraico and change the icon below links to download the file over a video on the operationtested on windows xp and Vista trouble with the Italian LANGUAGE with c menu in Windows 7 does not create the context menu could improve it?link to sfxhttp://rapidgator.net/file/37500924/7zsfx_windows_XP_Vista_win7-32-64-MI.exe.htmllink to videohttp://youtu.be/fdRV6KzjQpU Edited August 31, 2012 by odar Link to comment Share on other sites More sharing options...
submix8c Posted July 8, 2012 Share Posted July 8, 2012 (edited) The OP specifically states that the call to MSIEXEC is done from within a Visual Studio "SETUP.EXE" that they have compiled, which means the path given within the SETUP.EXE is not working. The problem is not with 7-Zip but with the USER-WRITTEN PROGRAM (written in Visual Studio, maybe a C++ Program, which internally calls MSIEXEC with an improper path)! BAT files will not fix this. The PROGRAM needs fixed! Here is a hint... Edited July 8, 2012 by submix8c Link to comment Share on other sites More sharing options...
submix8c Posted July 11, 2012 Share Posted July 11, 2012 Not meaning to bump this topic, but here's an interesting and related article about Junction Points / Reparse Points (with some basic code examples). Link to comment Share on other sites More sharing options...
odar Posted July 13, 2012 Share Posted July 13, 2012 (edited) ;!@Install@!UTF-8!InstallPath="%temp%\\Mysetup"RunProgram="msistub MySetup.msi /qb-!"Delete="%%T";!@InstallEnd@!msistub.exe Edited July 13, 2012 by odar Link to comment Share on other sites More sharing options...
submix8c Posted July 14, 2012 Share Posted July 14, 2012 Thx, Odar, but you still don't get it...the Original Poster is CALLING all of the checks and installs from HIS OWN VISUAL STUDIO PROGRAM! Meaning... the MSI is NOT to be called/installed from 7-zip SEPARATELY!!! JUST THE SETUP.EXE (which (1) checks the registry to see if PGM installed and (2) if not, Installs it).Capice???Please reread the thread.... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now