- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to use SELECTED_LANGUAGE as a condition in Custom Action
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
I have a InstallScript MSI project. The Installation supports multiple languages. So at the end of the installation, the installer needs to run a batch file which is corresponding to the user selected language. For example if user selected French in the language dialog, the batch file French.bat will be executed; If user selects English, the English.bat will be executed.
1) What is the best way to do this?
2) I treid to create a Custom Action with the type of Launch EXE and set the Batch file name as the parameter for the cmd.exe . In this case, I need to use SELECTED_LANGUAGE as the condition for running the Custom Action. I tried the following condition:
(SELECTED_LANGUAGE=ISLANG_FRENCH_STANDARD) AND (REMOVE<>"ALL") AND (NOT INSTALLED) AND (NOT UPGRADINGPRODUCTCODE)
However, the cmd.exe is called when non French language is selected. It looks like SELECTED_LANGUAGE=ISLANG_FRENCH_STANDARD does not work in custom actions. I verified the SELECTED_LANGUAGE in Installscript and it is French in this test case.
Can SELECTED_LANGUAGE be used as a condition in Custom Action? and how?
Thank you.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @AceBear ,
yes you can construct the path like that, but no need to put square bracket
sLangFileFullPath = ProgramFiles64Folder + "\\French.bat";
See whether you are able to execute the batch file using LaunchAppAndWait
Some time LaunchAppAndWait looks for the batch file again in the Program Files 86 folder, in that case you can disable the WOW64 redirection by calling below methods
Disable(WOW64FSREDIRECTION);
LaunchAppAndWait .....
Enable(WOW64FSREDIRECTION)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @AceBear ,
It cannot be used in the custom action condition, its a variable defined in Installscript, so only used in Installscript:
As you are using InstallScript MSI, you can write the code to run the corresponding batch file in installscript events based on the SELECTED_LANGUAGE, or even through a Installscript custom action.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Thank you @banna_k
The challenge for me is that these Batch files are copied to [INSTALLDIR] which is definded as [ProgramFiles64Folder]\subfolder . I want to use the following function to launch the Batch files, but I am not sure if I can construct the sLangFileFullPath like the following?
sLangFileFullPath = [ProgramFiles64Folder] + "\\French.bat";
LaunchAppAndWait(sLangFileFullPath , "abc", LAAW_OPTION_WAIT_INCL_CHILD);
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @AceBear ,
yes you can construct the path like that, but no need to put square bracket
sLangFileFullPath = ProgramFiles64Folder + "\\French.bat";
See whether you are able to execute the batch file using LaunchAppAndWait
Some time LaunchAppAndWait looks for the batch file again in the Program Files 86 folder, in that case you can disable the WOW64 redirection by calling below methods
Disable(WOW64FSREDIRECTION);
LaunchAppAndWait .....
Enable(WOW64FSREDIRECTION)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Thank you. This works.