PDA

View Full Version : Command-Line options



Phil
02-27-2008, 07:10 AM
Hiho,
i want to change a Variable in my script via the Command-Line.
I created this batch-file:

"C:\....\sbuilder.exe" /C "C:\.....\<myproject>.sb6" /SC Var 1
In my Script i wrote:

Set %_Var_% to "" (Also i tried without _ , with "0" ... nothin' changed...)
<blablaba......>
If %_Var_% equals "1" Then
Install ...
Install ...
etc
End
<blablabla...>
If %_Var_% equals "1" Then
Install ...
Install ...
etc
End

(i know, i wrote it 2 times)
my setup doesnt install the files i want him to install!!

What is wrong?
My parameters?
I have been trying for 3 hours. ...
I need help please ... =D
Is there any chance to get a logfile of what the compiler does ? I dont mean the std-output in sb6 itsself, i mean a real logfile...

linder
02-27-2008, 07:17 AM
Phil,

Sorry, but I fear I do not understand. You would like to change a runtime variable (e.g. %RUNTIME_VAR%) when you *compile* a script?

If yes, you have to use a compiler variable here. You can then set the compiler variable at compile time:

In your script:

Set Variable %_VAR_% to [MYCOMPILERVAR]

Then compile:

SBUILDER.EXE /C "C:\Development\Sample.sb6" /CV MYCOMPILERVAR "1"

Does this help?

Friedrich

Unregistered
02-27-2008, 08:00 AM
First: Thanks for your help!
Second: It didnt work.
I tried it.
First error:
Unknown Compilervar [MYCOMPILEVAR]

At "Compiler Variables" i inserted:
[MYCOMPILEVAR] (Value = 0)

I run my script with the parameters you told me to do.
Commandline closed itself after one second.

I want to be able to build 2 Setups. One time with special files, one time without. but i dont want to handle with 2 sb6 files. Any suggestions?
Hopefully
Phil

linder
02-27-2008, 08:03 AM
Phil,

This could be too obvious, but I will ask, did you define the compiler variable?

For example, in the "Compiler Variable Visualizer" or via the "#set compiler variable" compiler directive?

Friedrich

linder
02-27-2008, 08:06 AM
By the way, what you are trying to do is very simple and of course, SetupBuilder can handle it.

For example, we have one script for five producs and last week we have finished a consulting project script that compiles 12 different products from one .sb6 source project (via the command line).

Friedrich

Phil
02-27-2008, 08:08 AM
hmmmm...
At Compiler Variables... i inserted the entry [MYCOMPILEVAR] (with the Value 0)
but i think thats not the "define" you mean...
Could you explain yourself a lil' bit more please ?
If its the thing you mean.
Yes i did.



At "Compiler Variables" i inserted:
[MYCOMPILEVAR] (Value = 0)


I AM able to compile my project with this entry, but only via the Interface. (Test, compile, run)
My script didnt do anything...

Phil
02-27-2008, 08:13 AM
hahahah ^^
i wanted to post my script right now and i saw a " is missing :D
fixed it, ... it compiles now again, but not with the special files...
i think im too stupid... =D

I defined (Compiler Variable Visualizer)
[MYCOMPILEVAR] (WIth the value 0)

i wrote in my script:

Set %_VAR_% to "[MYCOMPILEVAR]"

If %_VAR_% equals "1" then
install ....
end
and so on

thanks for your endurance!

phil

linder
02-27-2008, 08:29 AM
Phil,

Please see attached test.sb6 script.

[MYCOMPILERVAR] is defined in the Compiler Variables Visualizer.

If you command line compile with:

SBUILDER.EXE /C "C:\Development\test.sb6" /CV MYCOMPILERVAR "1"

then the %MYVAR% runtime variable is set to 1 at installer runtime.

The installer will display the message box in Line 29

If you command line compile with:

SBUILDER.EXE /C "C:\Development\test.sb6" /CV MYCOMPILERVAR "0"

then the %MYVAR% runtime variable is set to 0 at installer runtime.

The installer will display the message box in Line 31

Does this help?

Phil
02-28-2008, 01:09 AM
I dont know why, but your answer isnt listed in the list above. Whatever, it works. I am such a fool... I wrote another compilervar in the .bat ... =D
Thank you very very very much for your ensurance.
But i have another Problem.
The executable Setup should have different namens. Is there any command (Script editor) to change the .exe Name?
Hopefully,
Phil

Phil
02-28-2008, 01:10 AM
Now it is listed...
Doesnt matter...

linder
02-28-2008, 01:17 AM
Hi Phil,

:) Absolutely no problem. We are here to help!

To change the exe name from a command line compile, just set the [EXENAME] compiler variable.

For example:

SBUILDER.EXE /C "C:\Development\test.sb6" /CV MYCOMPILERVAR "1" /CV EXENAME "Phil.exe"

Does this help?

Friedrich

Phil
02-28-2008, 01:27 AM
For example:

SBUILDER.EXE /C "C:\Development\test.sb6" /CV MYCOMPILERVAR "1" /CV EXENAME "Phil.exe"


I thought i have to change the [PRODUCTNAME]-Variable. Is it possible to Combine Variables?
For example:

Set %_SB_PROGRAMGROUP% to [PRODUCTNAME] + [SPEC_NAME]

Much thanks for your help :-)

Phil

linder
02-28-2008, 01:40 AM
Hi Phil,

Yes, this is possible. But don't use "+" because this would really add a "+" to your variable value.

Just use:

[PRODUCTNAME] [SPEC_NAME]

Friedrich

Phil
02-28-2008, 01:57 AM
Thanks!!!
I went another way, i changed in the General Informations my [EXENAME]-Variable to: Example[MYCOMPILEVAR].exe

Thanks for your help!
Thanks :-)
I cannot say it enough times!

Best wishes,
Phil

linder
02-28-2008, 02:13 AM
You are very welcome, Phil :)

Have a great day!

Friedrich