Jump to content

7z SFX Modified Module and Tools


Oleg_Sch

Recommended Posts


New 7zSFX_Shortcuts.7z updated including:

7zSFX_Install.reg | 7zSFX_Uninstall.reg | ReadMe.txt (English, French) | Image to see the shorcuts.

Thanks to improve or tell me if there is errors!

Enjoy!

*Edit: Updated and added 3 seconds to close the command prompt

Available for x86 or x64 sfx modified modules!

7zSFX_Shortcuts.7z

Edited by myselfidem
Link to comment
Share on other sites

Hi All.

Me Test Code But Show Me Error :

Error in Line 4 of configuration data:


;!@Install@!UTF-8!
GUIMode="2"
RunProgram="x86:hidcon:cmd /c \"%%T\\file_x86.cmd""
RunProgram="x64:hidcon:cmd /c \"%%T\\file_x64.cmd""
;!@InstallEnd@!

Plz Help For Fix.

Link to comment
Share on other sites

Yes, gives error!

You can use 7zsd_All.sfx and this config.txt


;!@Install@!UTF-8!
GUIMode="2"
RunProgram="x86:hidcon:cmd /c file_x86.cmd"
RunProgram="x64:hidcon:cmd /c file_x64.cmd"
;!@InstallEnd@!

Or:


;!@Install@!UTF-8!
GUIMode="2"
RunProgram="x86:hidcon:cmd /c %%T\\file_x86.cmd"
RunProgram="x64:hidcon:cmd /c %%T\\file_x64.cmd"
;!@InstallEnd@!

Tested for Daemon Tools Lite and works fine!

Edited by myselfidem
Link to comment
Share on other sites


;!@Install@!UTF-8!
GUIMode="2"
RunProgram="x86:hidcon:cmd /c \"%%T\\file_x86.cmd""
RunProgram="x64:hidcon:cmd /c \"%%T\\file_x64.cmd""
;!@InstallEnd@!

Plz Help For Fix.

Correct variants:

;!@Install@!UTF-8!
GUIMode="2"
RunProgram="x86:hidcon:cmd /c \"%%T\\file_x86.cmd\""
RunProgram="x64:hidcon:cmd /c \"%%T\\file_x64.cmd\""
;!@InstallEnd@!

;!@Install@!UTF-8!
GUIMode="2"
RunProgram="x86:hidcon:cmd /c file_x86.cmd"
RunProgram="x64:hidcon:cmd /c file_x64.cmd"
;!@InstallEnd@!

;!@Install@!UTF-8!
GUIMode="2"
RunProgram="x86:hidcon:file_x86.cmd"
RunProgram="x64:hidcon:file_x64.cmd"
;!@InstallEnd@!

;!@Install@!UTF-8!
GUIMode="2"
RunProgram="%%P:hidcon:file_%%P.cmd"
;!@InstallEnd@!

This variant is not correct too:

;!@Install@!UTF-8!
GUIMode="2"
RunProgram="x86:hidcon:cmd /c %%T\\file_x86.cmd"
RunProgram="x64:hidcon:cmd /c %%T\\file_x64.cmd"
;!@InstallEnd@!

Link to comment
Share on other sites

Hello

P.S if i try to do it after windows is install and run wpi then it works fine to unpack and make a desktop and show over

If you want create a shorcut(s) using 7zsd.sfx modified module you can read the explanation here:

http://7zsfx.info/en/

Configuration file parameters | Shorcut

You can also see an example for Tools for 7z SFX inside Usage examples (# 5)

As example, I create an sfx file customized (using the example above) with two shorcuts on the Desktop:

config.txt


;!@Install@!UTF-8!
GUIMode="2"
InstallPath="%ProgramFiles%\\7z SFX Tools"
OverwriteMode="2"
Shortcut="D,{%%T\\7zSD_EN.chm},{},{},{Description Modified 7z SFX module},{7z SFX module chm},{},{%%T\\7zSD_EN.chm},{0}"
Shortcut="D,{%%T\\7ZSplit.exe},{},{},{7z SFX module},{7z archive Splitter},{},{%%T\\7z.ico},{0}"
;!@InstallEnd@!

I set 7z.ico inside the archive 7z first, to have another one!

Two shorcuts are on my Desktop to open 7zSD_EN.chm and another to open 7ZSplit.exe

HTH

Edited by myselfidem
Link to comment
Share on other sites

New 7zSFX_Shortcuts.7z updated including:

7zSFX_Install.reg | 7zSFX_Uninstall.reg | ReadMe.txt (English, French) | Image to see the shorcuts.

Thanks to improve or tell if there is errors!

Enjoy!

I use your first version to create sfx (with output exe name fix), one fot x86 an other for x64 sfx file...

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\7zSFX86]
"MUIVerb"="Create file 7z-sfx x86"
"NoWorkingDirectory"=""
"Icon"="C:\\Program files\\7-Zip\\7zG.exe, 0"
"Extended"=-

[HKEY_CLASSES_ROOT\Directory\shell\7zSFX86\command]
@="cmd.exe /c cd/d \"%1\" && cmd.exe /c copy /b \"C:\\Program files\\7-Zip\\7zsd_All.sfx\" + *.txt + *.7z NewSfx86.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\7zSFX86]
"MUIVerb"="Create file 7z-sfx x86"
"NoWorkingDirectory"=""
"Icon"="C:\\Program files\\7-Zip\\7zG.exe, 0"
"Extended"=-

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\7zSFX86\command]
@="cmd.exe /c cd/d \"%1\" && cmd.exe /c copy /b \"C:\\Program files\\7-Zip\\7zsd_All.sfx\" + *.txt + *.7z NewSfx86.exe"

[HKEY_CLASSES_ROOT\Directory\shell\7zSFX64]
"MUIVerb"="Create file 7z-sfx x64"
"NoWorkingDirectory"=""
"Icon"="C:\\Program files\\7-Zip\\7zG.exe, 0"
"Extended"=-

[HKEY_CLASSES_ROOT\Directory\shell\7zSFX64\command]
@="cmd.exe /c cd/d \"%1\" && cmd.exe /c copy /b \"C:\\Program files\\7-Zip\\7zsd_All_x64.sfx\" + *.txt + *.7z NewSfx64.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\7zSFX64]
"MUIVerb"="Create file 7z-sfx x64"
"NoWorkingDirectory"=""
"Icon"="C:\\Program files\\7-Zip\\7zG.exe, 0"
"Extended"=-

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\7zSFX64\command]
@="cmd.exe /c cd/d \"%1\" && cmd.exe /c copy /b \"C:\\Program files\\7-Zip\\7zsd_All_x64.sfx\" + *.txt + *.7z NewSfx64.exe"

7zsd_All.sfx and 7zsd_All_x64.sfx must be inside 7-zip install folder...

And this for 7zSplit:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\7zSplit]
@="7ZSplitter"
"Icon"="C:\\Program files\\7zSplit\\7z.ico"
"Position"="Top"

[HKEY_CLASSES_ROOT\*\shell\7zSplit\command]
@="\"C:\\Program files\\7zSplit\\7ZSplit.exe\" \"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\7zSplit]
"Path"="C:\\Program files\\7zSplit\\7ZSplit.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\7ZSplit.exe]
@="C:\\Program files\\7zSplit\\7ZSplit.exe"
"Path"="C:\\Program files\\7zSplit"

Regards and thanks... ;-)

Edited by alfreire
Link to comment
Share on other sites

For test:

;!@Install@!UTF-8!
Title="Variables %7zSfxVarModulePlatform% module in %%P OS"
BeginPrompt=" Check of variables %7zSfxVarModulePlatform% module in %%P OS

• Click 'OK', variables will are shown in a console window

• Click 'OK', retaining [Shift], variables will be are saved
to the file %SystemDrive%\\vars_%7zSfxVarModulePlatform%_module_on_%%P_OS.txt"
FinishMessage="The module %7zSfxVarModulePlatform% finished operation"
;
SetEnvironment="cmnd=@Echo Off& Title Module - %7zSfxVarModulePlatform%, OS - %%P& Echo Module - %7zSfxVarModulePlatform%, OS - %%P& Echo.& Echo Folders:&Set 7zSfxFolder& Echo.& Echo Vars:&Set 7zSfxVar& Echo %%^M=%%M& Echo %%^P=%%P& Echo %%^S=%%S& Echo %%^T=%%T& Set CommonD& Set MyDoc& Echo UserDesktop=%UserDesktop%& Echo."
RunProgram="hidcon:cmd /c Echo"
RunProgram="%%P:fm0:cmd /k %cmnd%"
AutoInstall="hidcon:cmd /c Echo"
AutoInstall="%%P:fm20:hidcon:cmd /c (%cmnd%)>%SystemDrive%\\vars_%7zSfxVarModulePlatform%_module_on_%%P_OS.txt"
GUIMode="2"
GUIFlags="2+4+8+16+32+2048+4096"
;!@InstallEnd@!
;!@Install@!UTF-8:Language:1049!
Title="Переменные %7zSfxVarModulePlatform% модуля в %%P ОС"
BeginPrompt=" Проверка переменных %7zSfxVarModulePlatform% модуля в %%P ОС

• Нажмите 'OK', переменные будет показаны в окне консоли

• Нажмите 'OK', удерживая [Shift], переменные будет
сохранены в файл %SystemDrive%\\vars_%7zSfxVarModulePlatform%_module_on_%%P_OS.txt"
FinishMessage="Модуль %7zSfxVarModulePlatform% завершил работу"
;!@InstallEnd@:Language:1049!

Version module for test 1.6 build 2496

Finally, I undertstand your test... X-D Thanks again... ;-)

        Module - x86,      OS - x64

Folders:
7zSfxFolder00=C:\Users\Administrador\Desktop
7zSfxFolder02=C:\Users\Administrador\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
7zSfxFolder05=C:\Users\Administrador\Documents
7zSfxFolder06=C:\Users\Administrador\Favorites
7zSfxFolder07=C:\Users\Administrador\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
7zSfxFolder08=C:\Users\Administrador\AppData\Roaming\Microsoft\Windows\Recent
7zSfxFolder09=C:\Users\Administrador\AppData\Roaming\Microsoft\Windows\SendTo
7zSfxFolder11=C:\Users\Administrador\AppData\Roaming\Microsoft\Windows\Start Menu
7zSfxFolder13=C:\Users\Administrador\Music
7zSfxFolder14=C:\Users\Administrador\Videos
7zSfxFolder16=C:\Users\Administrador\Desktop
7zSfxFolder19=C:\Users\Administrador\AppData\Roaming\Microsoft\Windows\Network Shortcuts
7zSfxFolder20=C:\Windows\Fonts
7zSfxFolder21=C:\Users\Administrador\AppData\Roaming\Microsoft\Windows\Templates
7zSfxFolder22=C:\ProgramData\Microsoft\Windows\Start Menu
7zSfxFolder23=C:\ProgramData\Microsoft\Windows\Start Menu\Programs
7zSfxFolder24=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
7zSfxFolder25=C:\Users\Public\Desktop
7zSfxFolder26=C:\Users\Administrador\AppData\Roaming
7zSfxFolder27=C:\Users\Administrador\AppData\Roaming\Microsoft\Windows\Printer Shortcuts
7zSfxFolder28=C:\Users\Administrador\AppData\Local
7zSfxFolder29=C:\Users\Administrador\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
7zSfxFolder30=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
7zSfxFolder31=C:\Users\Administrador\Favorites
7zSfxFolder32=C:\Users\Administrador\AppData\Local\Microsoft\Windows\Temporary Internet Files
7zSfxFolder33=C:\Users\Administrador\AppData\Roaming\Microsoft\Windows\Cookies
7zSfxFolder34=C:\Users\Administrador\AppData\Local\Microsoft\Windows\History
7zSfxFolder35=C:\ProgramData
7zSfxFolder36=C:\Windows
7zSfxFolder37=C:\Windows\system32
7zSfxFolder38=C:\Program Files (x86)
7zSfxFolder39=C:\Users\Administrador\Pictures
7zSfxFolder40=C:\Users\Administrador
7zSfxFolder41=C:\Windows\SysWOW64
7zSfxFolder42=C:\Program Files (x86)
7zSfxFolder43=C:\Program Files (x86)\Common Files
7zSfxFolder44=C:\Program Files (x86)\Common Files
7zSfxFolder45=C:\ProgramData\Microsoft\Windows\Templates
7zSfxFolder46=C:\Users\Public\Documents
7zSfxFolder47=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools
7zSfxFolder48=C:\Users\Administrador\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Administrative Tools
7zSfxFolder53=C:\Users\Public\Music
7zSfxFolder54=C:\Users\Public\Pictures
7zSfxFolder55=C:\Users\Public\Videos
7zSfxFolder56=C:\Windows\resources
7zSfxFolder59=C:\Users\Administrador\AppData\Local\Microsoft\Windows\Burn\Burn

Vars:
7zSfxVarCmdLine0=
7zSfxVarCmdLine1=
7zSfxVarCmdLine2=
7zSfxVarModulePlatform=x86
7zSfxVarSystemLanguage=3082
7zSfxVarSystemPlatform=x64
%%M=NewSfx86.exe
%%P=x64
%%S=C:\Users\Administrador\Desktop
%%T=C:\Users\ADMINI~1\AppData\Local\Temp\7ZipSfx.001
CommonDesktop=C:\Users\Public\Desktop
CommonDocuments=C:\Users\Public\Documents
MyDocs=C:\Users\Administrador\Documents
MyDocuments=C:\Users\Administrador\Documents
UserDesktop=C:\Users\Administrador\Desktop

Link to comment
Share on other sites

A question about InstallPath, how do I get the path "Program files" on x86 and x64...?

If I put InstallPath="%programfiles%" I get c:\Program files in x86 and c:\Program files(x86) in x64... x86: and x64: don't work with this command... :unsure:

Regards... ;-)

Wow, I'm stupid... InstallPath="C:\\Program files" :blushing::whistle: hahahahaha X-D

Edited by alfreire
Link to comment
Share on other sites

  • 2 weeks later...

Or you could use 64 bit module.

Also, from Wikipedia:

%ProgramFiles%

This variable points to Program Files directory, which stores all the installed program of Windows and others. The default on English-language systems is C:\Program Files. In 64-bit editions of Windows (XP, 2003, Vista), there are also %ProgramFiles(x86)% which defaults to C:\Program Files (x86) and %ProgramW6432% which defaults to C:\Program Files. The %ProgramFiles% itself depends on whether the process requesting the environment variable is itself 32-bit or 64-bit (this is caused by Windows-on-Windows 64-bit redirection).

Link to comment
Share on other sites

Or you could use 64 bit module.

Also, from Wikipedia:

%ProgramFiles%

This variable points to Program Files directory, which stores all the installed program of Windows and others. The default on English-language systems is C:\Program Files. In 64-bit editions of Windows (XP, 2003, Vista), there are also %ProgramFiles(x86)% which defaults to C:\Program Files (x86) and %ProgramW6432% which defaults to C:\Program Files. The %ProgramFiles% itself depends on whether the process requesting the environment variable is itself 32-bit or 64-bit (this is caused by Windows-on-Windows 64-bit redirection).

Thanks for info... :thumbup

Regards... ;)

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

;!@Install@!UTF-8!
GUIMode="1"
MiscFlags="4"
RunProgram="x86:hidcon:file_x86.cmd"
RunProgram="x64:hidcon:file_x64.cmd"
;!@InstallEnd@!

file_x86.cmd:

rename "%CommonProgramFiles(x86)%\Program\Test\library.dll" library.bak
xcopy /y library.dll "%CommonProgramFiles(x86)%\Program\Test\"
del /F /Q "%ProgramFiles(x86)%\Program\Test\file.exe"
regedit /S regfile.reg
shutdown -r -t 3

Regards... ;-) :hello:

Inside your config.txt, try: GUIMode="2"

config.txt (saved as UTF-8 file)


;!@Install@!UTF-8!
GUIMode="2"
MiscFlags="4"
RunProgram="x86:hidcon:cmd /c \"%%T\\file_x86.cmd""
RunProgram="x64:hidcon:cmd /c \"%%T\\file_x64.cmd""
;!@InstallEnd@!

I think the batch need to be improved:

file_x86.cmd


@echo off
MKDIR "%CommonProgramFiles(x86)%\Program\Test"
XCOPY /Y "%~dp0library.dll" "%CommonProgramFiles(x86)%\Program\Test\" /C /I /E /H /R
REN "%CommonProgramFiles(x86)%\Program\Test\library.dll" library.bak
DEL /F /Q "%ProgramFiles(x86)%\Program\Test\file.exe"
REGEDIT /S "%~dp0regfile.reg"
shutdown -r -t 3

Assuming the regfile.reg and library.dll are inside your SFX file!

However, I think it's not a good idea to restart the computer at last using SFX file with a batch file!

Because the temp folder will be removed and the batch file is already in use and errors may occurs.

*Edit: errors about quotes inside config.txt updated and corrected!

Hello,

Hopefully I can get some help. The MiscFlags="4" is not working for me as well. I tried using the 7zsd_All.sfx and 7zsd_LZMA2.sfx. I'm very new to SFX so just to be clear - I would like the sfx executable I'm creating to prompt for administrator.

Config:

;!@Install@!UTF-8!

Title="Enterprise 6.0.1"

GUIMode="2"

MiscFlags="4"

RunProgram="x64:%%T\x64\setup.exe"

RunProgram="x86:%%T\x86\setup.exe"

;!@InstallEnd@!

Thanks in advanced!

Edited by DomenicP
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...