• Announcements

    • xper

      MSFN Sponsorship and AdBlockers!   07/10/2016

      Dear members, MSFN is made available via subscriptions, donations and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, become a site sponsor and ads will be disabled automatically and by subscribing you get other sponsor benefits.
Oleg_Sch

7z SFX Modified Module and Tools

511 posts in this topic

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).

1

Share this post


Link to post
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... ;)

0

Share this post


Link to post
Share on other sites

how set Password for .sfx

You must put password in *.7z file, before make *.sfx file...

Regards... ;-)

0

Share this post


Link to post
Share on other sites

;!@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
0

Share this post


Link to post
Share on other sites

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!

GUIMode="2"

MiscFlags="4"

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

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

;!@InstallEnd@!

Thanks in advanced!

Can anyone please help me out? This is driving me crazy and I need to resolve it. Thanks you.

0

Share this post


Link to post
Share on other sites

I have one question regarding SFX archives created using WinRAR and I am expecting a very fast reply as it is very urgent for me.

I have to create one SFX file that can be installed in both, 32 or 64 bit machines. But, I want to know if it is possible to give the extraction path dynamically, i mean Can the SFX itself decide in which %ProgramFiles% it should extract contents.? In 32 bit we have Program Files folder and in 64 bit, we have Program files(x86).

Please help me ASAP

0

Share this post


Link to post
Share on other sites

I know you are desperate, but posting the same post in multiple places will not get you a response any faster, you will just p*ss people off and you will be ignored. No one cares how urgent it is for you - that is not our problem. Pick ONE thread to leave your post and delete the other posts. It will be seen and someone will respond if they have anything useful.

Cheers and Regards

0

Share this post


Link to post
Share on other sites

Can you give a beta version of the SuRun for reproduce error? I can't download it now.

It does not seems to occur in the recent beta 6, but happens here in SuRun1211b5.zip

Edited by JFX
0

Share this post


Link to post
Share on other sites

Hello... I have a problem with some 7zsfx files in Windows 8 (other files works perfect)... I got error message : "Non 7z archive." That 7zsfx files works perfect in Win XP, Win 7 x86 and x64... :unsure:

An example of config file:

;!@Install@!UTF-8!
GUIMode="0"
MiscFlags="4"
GUIFlags="2+4+8+16+32+2048"
Title="Mozilla Firefox v19.0 b4 esp Silent..."
BeginPrompt=" Creado por -=cr@ckm@n=-

¿Quieres instalar Mozilla Firefox...?"
ExtractTitle="Extrayendo archivos..."
ExtractDialogText="Mozilla Firefox v19.0 b4 español"
ExtractCancelText="Cancelar la instalación"
RunProgram="setup.exe -ms"
FinishMessage="Instalación finalizada correctamente... ;-)"
;!@InstallEnd@!

Regards... ;-)

post-329917-0-87301000-1359642607_thumb.

Edited by alfreire
0

Share this post


Link to post
Share on other sites

Well.. I auto-answer to myself... :sneaky: I updated sfx module to v1.6 develop (build 2712) and works now... :whistle:

Regards... ;-)

Edited by alfreire
0

Share this post


Link to post
Share on other sites

Hi, friends... One question, how to make work this command...?

Delete="%%T\\*.reg"

*.reg not working... I tried this

Delete="%%T\\\"*.reg\""

and this

Delete="\"%%T\\*.reg\"" 

and this

SetEnvironment="Variable1=*.reg"
Delete="%%T\\%Variable1%"

but not working too... :no:

Regards... ;-)

p.d.: This command works perfect...

RunProgram="hidcon:cmd /c del \"%%T\\*.reg\"" 

Edited by alfreire
0

Share this post


Link to post
Share on other sites

2 alfreire

The module does not support wildcard (*,?)

0

Share this post


Link to post
Share on other sites

2 alfreire

The module does not support wildcard (*,?)

Thank you very much, Gora... appreciate your help... :rolleyes:

Cheers and regards... ;-)

0

Share this post


Link to post
Share on other sites

Hello,

I would like to know If is possible to give the extraction path as a parameter.

i.e In config.txt file I set the InstallPath="%TEMP%" dir for extraction path but I want the user to have the option to choose the extraction path and overwrite the setting in config file.

is that possible?

Cheers,

c0nf

0

Share this post


Link to post
Share on other sites

is that possible?

Yes.

sfx.exe -InstallPath="%ProgramFiles%\\NewFolder"

0

Share this post


Link to post
Share on other sites

thank you very much for your fast reply, it works!

Cheers

0

Share this post


Link to post
Share on other sites

this reg file for create module sfx.exe to context menu right clic

7zsfx3.reg

add 3 voice

create 7z archive (folder compress in 7z)

create sfx (folder container module 7zs*.sfx + file conf*.txt + file *.7z)

create sfx folder (module sfx + file config.txt in folder compress and convert in sfx)

file (win_7_8_contexmenu_ 7zsfx.7z for win 7-8 reg) file in context menu in cascade mode work in window 7 and windows 8 (x86 x64)

win_7_8_contexmenu_ 7zsfx.7z

Edited by odar
0

Share this post


Link to post
Share on other sites

Hello,

I would like to ask if is possible to propagate the exit code of "myprogram.exe" when the sfx file finish?


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

For example if myprogram.exe will exit with code 9 I want sfx file to return the same code.

Thank you,

c0nf

0

Share this post


Link to post
Share on other sites
;!@Install@!UTF-8!
GUIMode="2"
RunProgram="hidcon:cmd /c myprogram.exe & Echo %ErrorLevel% >\"%%S\\Errorlog.txt\""
Autoinstall="hidcon:cmd /c myprogram.exe & Echo %ErrorLevel% >\"%%S\\Errorlog.txt\""
;!@InstallEnd@!

0

Share this post


Link to post
Share on other sites

;!@Install@!UTF-8!
GUIMode="2"
RunProgram="hidcon:cmd /c myprogram.exe & Echo %ErrorLevel% >\"%%S\\Errorlog.txt\""
Autoinstall="hidcon:cmd /c myprogram.exe & Echo %ErrorLevel% >\"%%S\\Errorlog.txt\""
;!@InstallEnd@!

Hi gora,

thank you for your answer,

I can't test it for the moment to be sure so just to clarify for the forum operation :),

is this command will just print the Exit code in the error.txt file or will propagate it also in the exit code of my sfx file?

Cheers,

c0nf

0

Share this post


Link to post
Share on other sites

Hello,

I would like to ask if is possible to propagate the exit code of "myprogram.exe" when the sfx file finish?


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

For example if myprogram.exe will exit with code 9 I want sfx file to return the same code.

Thank you,

c0nf

I think understand your question, but don't understand why...? can you explain me...?

Regards... ;-)

Edited by alfreire
0

Share this post


Link to post
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.