Jump to content
MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. ×

7z SFX Modified Module and Tools


Oleg_Sch
 Share

Recommended Posts

I have a sfx extraction question. Does anyone know of a way to supress pop-up error messages and have them write out the cmd prompt or txt instead?

 

I use the sfx with automated deployments of unattended installs and every once in a while I get an install that hangs. Since the installs are being done under a deployment account, we can't access the desktop to see the error message. This makes troubleshooting hard and time consuming. So far the hanging seems to be typically caused by a locked files or an invalid path.

 

Example of extraction command:

 

mySfx.exe" -y -gm2 -InstallPath="C:\\mySfxPath\\location"

 

Thank you,

ThePackager

 

Link to comment
Share on other sites

  • 1 month later...

Hi,

 

I'm trying to pass a parameter containing spaces when calling the installer, but it doesn't seem to work. For example :

installer.exe -! firstParam "C:\some path with space\test"

This is supposed to call a .bat file and pass it the two parameters. The .bat is declared as :

RunProgram="cmd /C \"%%T\test.bat\""

It doesn't work. It seems that as soon as there is a quote in the parameters passed to "installer.exe", then "test.bat" is not called correctly.

 

When I do not use spaces or quotes :
 

installer.exe -! firstParam secondParam

Then "test.bat" correctly receives "secondParam" as the second parameter!

 

How can I pass a parameter containg spaces? I've tried without success :
 

installer.exe -! firstParam "C:\some path with space\test"installer.exe -! firstParam \"C:\some path with space\test\"installer.exe -! firstParam \\"C:\some path with space\test\\"

Even that doesn't work :

installer.exe -! firstParam "secondParam"

Thanks in advance!

Edited by electrotype
Link to comment
Share on other sites

config:

;!@Install@!UTF-8!RunProgram="test.bat";!@InstallEnd@!

test.bat:

@Echo OffEcho %1Echo %2Pause

start line:

test.exe -! firstParam "C:\\some path with space\\test"

out console:

firstParam"C:\\some path with space\\test"Для продолжения нажмите любую клавишу . . .
Link to comment
Share on other sites

Well, I'll have to find what is different for me then!

 

I guess it has something to do with :

RunProgram="cmd /C \"%%T\test.bat\""

vs.

RunProgram="test.bat"

I'll check that tomorrow. Thanks for your help!

Link to comment
Share on other sites

Ok, so when launching using params with quotes, for example :

test.exe -! firstParam "secondParam"

This works :

RunProgram="cmd /C test.bat"

But this doesn't work :

RunProgram="cmd /C \"test.bat\""

The problem is that I need to put "test.bat" inside quotes because it is, in fact, more something like this in my case :

RunProgram="cmd /C \"%%T\\some path\\test.bat\""

The workaround is to remove "cmd /C" completely and then it works :

RunProgram="\"%%T\\some path\\test.bat\""

I'm not sure if there is a difference when launching the .bat directly or using "cmd /C" though...

Link to comment
Share on other sites

RunProgram="cmd /C \"%%T\\some path\\test.bat\""

In this line you want to remove unnecessary:

cmd /C

and

%%T\\

RunProgram="\"some path\\test.bat\""
Link to comment
Share on other sites

config:

SetEnvironment="SfxString25=Button OK"SetEnvironment="SfxString26=Button Cancel"SetEnvironment="SfxString27=Button Yes"SetEnvironment="SfxString28=Button No"

module version - 1.6 develop (build 2797) 25.03.13
 

 

YesNo.PNG

  • Upvote 1
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
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.


×
×
  • Create New...