PDA

View Full Version : Language selection (dialog) via command line



Tommyknocker
08-25-2010, 09:22 AM
I have a setup A created with SetupBuilder 7.2.2978.
This setup is a standalone setup.When the setup is started the language selection for the setup (German, English, French) appears.

Now I have a setup B, which can be executed in some more/other languages (German, English, Spanish, Dutch). This setup calls setup A.
In this case I donīt want to have the the language selection dialog for setup A again.

Here`s my question:
Is there a way in setup B to get the current language and add this language (as ID or whatever?) as a command line to the call of setup A? Setup A should react like the following:

If no language was entered via command line the language selection dialog should be displayed
if a language was entered via command line, the language selection should not be displayed. Then the setup has to check if it supports the language.
If language is supported, use this language
else use English as default language



Can anybody give me a hint or an example?
Thank you very much.

linder
08-25-2010, 09:43 AM
Hello,

IMO, you can't do this with the "standard" Show Language Dialog.

But please see "Radio Button 2.sb7" in the Example Package (no need to use radio buttons to handle this: you can use a combo control, you can create a custom dialog, etc.).

http://www.lindersoft.com/forums/showthread.php?t=24376

It demonstrates how to develop your own Language Selection method. Based on this, you should be able to achieve the above (even when running in silent mode). The "Set Active Setup Language" script function can be used in your "setup B" to set the language. Create your own command line switch to pass the (selected) language from setup A to setup B.

Does this help?

Friedrich

Tommyknocker
08-25-2010, 03:17 PM
Hello Friedrich,

thank you for your reply.
Setup A is not executed in silent/quite mode. Only the language selection shall not appear.

:confused:But it is not possible to hide the standard dialog, thatīs the reason why I should implement my own language selection dialog in Setup A!?


The "Set Active Setup Language" script function can be used in your "setup B" to set the language.
So that means the active language can be set at runtime?
Where can I find a list of valid IDs?
How can setup A check if it supports the language that will be passed as a command line switch from setup B to setup A?
Is there a way to get the languages that are supported by the standard language selection dialog?

How can setup B get the active setup language? Is there a runtime variable that contains the language ID that was selected from then standard language selection dialog?

Thank you for your help.

linder
08-26-2010, 04:14 AM
We'll upload a demo for you later today.

Friedrich

linder
08-26-2010, 05:04 AM
Please download http://www.lindersoft.com/projects/setupAB.zip

Compile the projects "setupA.sb7" and "setupB.sb7", then run setupB.exe. The projects will NOT modify your system in any way -- do NOT execute the projects in TEST mode.

setupA supports the languages German, English, and French.
setupB supports the languages German, English, Spanish, and Dutch.

If setupA is launched from setupB, then the selected language is carried over from B to A and the language selection dialog is NOT displayed in setupA. If the language is "unknown", then English is displayed. If no language ID is carried over, setupA also displays a language selection dialog.

Does this help?

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is Windows installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

Tommyknocker
08-26-2010, 06:50 AM
Hello Friedrich,

thank you for your help and your effort.
Because the setups were needed urgently I already created the setups like you explained in the last reply.

But I will check out your demo project, to see how to do it correct/better.

Thanks.

Tommyknocker
08-26-2010, 07:09 AM
Thank you for that excellent example. Itīs nearly the same I have done.
The only difference is the way to pass the command line parameters.

Your demo is doing it better or in a more readable way than I have done it.
I used the command line switch
/V UD_SETUP_LNG %UD_SETUP_LNG% to set the runtime variable UD_SETUP_LNG in the "embedded" setup B.

Using "Get System Info" to get the command line is much easier to read.
Image I would have 3 command line parameters. With my way it would be

/V RV1 VAL1 /V RV2 VAL2 /V RV3 VAL3, where
RVx is the name of the runtime variable and
VALx is the value to set. Seems to be more complicated than your solution.

Thanks.:)

linder
08-26-2010, 07:25 AM
Cool :) You are very welcome!

Friedrich