3 Replies Latest reply on Jun 13, 2014 12:05 PM by mm21xx

    Selective Shortcut Deployment with Thinreg?

    mm21xx Novice

      Hi,

       

      A new question for you all!

      We work in a bilingual environment.

      We have a specific Thinapp where the shotcut names differ between both languages.

      For example, we would have in English "Read Me" and in French "Lisez moi".

       

      The challenge we face is the following:

      If there a way to determine, depending on the language of the system, which shortcut to install onto the client's workstation (let's say desktop for this case).

       

      Basically, have a single Thinapp deploy a "Read Me" shortcut on the desktop if the system is in English, and "Lisez moi" shortcut on a desktop of a French system.

       

      Thanks!!

        • 1. Re: Selective Shortcut Deployment with Thinreg?
          oliAH Enthusiast

          There is nothing built-in in thinapp to do that so if I were in this situation, I would do it this way:

           

          -Create a package with 2 entry points, "Readme.exe" and "Lisez-moi.exe". Both will have the same definition:

          [Readme.exe]

          Source=%ProgramFilesDir%\App\app.exe

          Shortcut=App.dat

          WorkingDirectory=%ProgramFilesDir%\App

           

          [Lisez-moi.exe]

          Source=%ProgramFilesDir%\App\app.exe

          Shortcut=App.dat

          WorkingDirectory=%ProgramFilesDir%\App

           

          -In my thinreg script, I would do this:

          '=================================================

          ' Initialize vars

          '=================================================

          Dim strComputer, strOSLanguage

          Dim strThinregPath, strAppToRegister, strThinregCmdLine

           

          '=================================================

          ' Set thinreg path and params

          '=================================================

          strThinregPath = "\\fileserver\share\thinreg.exe"

           

          '=================================================

          ' Get Computer OS Language

          ' See: Win32_OperatingSystem class (Windows)

          '=================================================

          strComputer = "."

          Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

          Set oss = objWMIService.ExecQuery ("Select OSLanguage FROM Win32_OperatingSystem")

           

          For Each os in oss

              strOSLanguage = os.OSLanguage

          Next

           

          If strOSLanguage = 1036 or strOSLanguage = 3084 Then

              REM Wscript.Echo "OS Language: French – France / Canada"

                    strAppToRegister = "\\fileserver\share\Lisez-moi.exe"

          ElseIf strOSLanguage = 1033 or strOSLanguage = 4105 Then

              REM Wscript.Echo "OS Language: English – US / Canada"

                  strAppToRegister = "\\fileserver\share\Readme.exe"

          End If

           

          '=================================================

          ' Register the app

          '=================================================

          Set WSHShell = WScript.CreateObject("WScript.Shell")

          strThinregCmdLine = strThinregPath & " " & strAppToRegister

          WSHShell.Run "" & strThinregCmdLine & "", 0, True

           

          That's it!

           

          There're probably some other ways to do this with the thinapp APIs or the thinapp SDK so you might want to check them.

           

          Olivier

          • 2. Re: Selective Shortcut Deployment with Thinreg?
            mm21xx Novice

            Hi,

             

            Thanks for the prompt reply.

            When reading the script, it actually makes a lot of sense.

            I'll be doing a test in our environment to see how that fares and let you know.

            • 3. Re: Selective Shortcut Deployment with Thinreg?
              mm21xx Novice

              Due to the complexity of the Thinreg script we use here, I've taken a different approach to do it, based on exactly the same idea you've given me, and it works well!

               

              Thanks!!