Announcement

Collapse
No announcement yet.

Conditional install based on language

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Conditional install based on language

    Hi,

    I have to files corresponding to 2 languages (run500_uk.dll & run500_fr.dll) to install and the target must be run500.dll; in the settings/language, I have put the 2 languages (french & english) but I don't know how to achieve this installation, in the files/properties, I haven't found the way to put a condition according to the language dialog box.

    how can I do that ?
    a concrete example (code) would be appreciate.
    thanks in advance,
    Domi.

  • #2
    In the On Startup script, check for the target language. You can do this with System.GetDefaultLangID() or Language.GetDisplayLanguage(). You will need to compare the Primary language with the desired/expected values (9 or 12). If the value indicates that the language is English (9), then set a boolean (e.g. bIsEnglish) to true, otherwise set it to false. Finally, use that boolean variable in a Script Condition on the file for installation, as shown in the image below.

    Click image for larger version

Name:	SNAG-2013-10-01-02.png
Views:	1
Size:	12.4 KB
ID:	284080

    Ulrich

    Comment


    • #3
      Thanks for you fast reply Ulrich, I'm trying it ....

      another question (always regarding language selection) : is there any built-in dialog box to let the user to select the language at the start of the setup ? I'm referring to this thread (for version 8) : http://www.indigorose.com/forums/thr...log-on-startup; Darryl had retained this suggestion but I don't find it in the last version (vrs 9.2.0.0) ! if no, how can I do this ?

      Best regards,
      Domi.

      Comment


      • #4
        complement :

        if no, how can I do this to oblige all of the selection (text in dialog boxes, files, ...) to change according to the selection of the language ? is there a global variable which is used for this ?

        Domi.

        Comment


        • #5
          Please check Chapter 7 in the User Guide, which explains how to determine the current language, and how to change the installer's language at runtime.

          Ulrich

          Comment


          • #6
            Hi Ulrich,

            1°) Thanks for your notification, according to the manual, I have put "Application.SetInstallLanguage" in the "On Ctrl Message" in Actions but (it's maybe a bug) this doesn't refresh the current dialog box; only the next are OK.....

            2°) I'm back to your first reply using the 'script condition' on the file for installation; I'm trying to use a SessionVar instead of a boolean variable but

            this :



            or this :



            gives me a runtime error :



            This could be fine to be fixed in a future version or my syntax is wrong ?
            Sincerly,
            Domi.

            Comment


            • #7
              1°) Thanks for your notification, according to the manual, I have put "Application.SetInstallLanguage" in the "On Ctrl Message" in Actions but (it's maybe a bug) this doesn't refresh the current dialog box; only the next are OK.....
              This is not a bug. If you want to refresh the text when the language selection changes, you need to script this. I believe you are looking into this in your other topic.

              2°) I'm back to your first reply using the 'script condition' on the file for installation; I'm trying to use a SessionVar instead of a boolean variable but this ... gives me a runtime error
              This could be fine to be fixed in a future version or my syntax is wrong ?
              Your syntax is wrong. You need to use quotes around Session Variables. Your script condition wouldn't work as part of a script elsewhere, as you wrote it. It may be a good idea testing your conditions separately before applying them to files.

              Code:
              SessionVar.Get("%SessionLanguage%") ~= "FR"
              Ulrich

              Comment


              • #8
                Thanks for your reply Ulrich,

                my fault, that's right ! forgotten quotes - sorry ...

                but this doesn't seems to work with
                Code:
                SessionVar.Get("%SessionLanguage%") == "FR"
                and
                Code:
                SessionVar.Get("%SessionLanguage%") ~= "FR"
                I have tried your first method (with bIsEnglish) and this works perfectly, I'm investigating with the SessionVar ....

                Sincerly,
                Domi.

                Comment


                • #9
                  It may help if you post the project file, so we could see what you are actually doing. For example, you may not be setting the Session Variable properly or at all, or there may be a mismatch in the case, etc. Without seeing the code, we can only guess, which isn't very productive.

                  Ulrich

                  Comment

                  Working...
                  X