home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer 3.8 / 1997-11_Disc_3.8.bin / DKMAGDEM / KEEPER / WinSetup / SETUP.RUL < prev    next >
Text File  |  1997-05-28  |  5KB  |  144 lines

  1. // Dungeon Keeper Install Shield 3 Language Selector
  2. // RReed    Feb 22,'97
  3. // Note: Localization taken from the registery.
  4. // A language is determined or selected here & the relevant script is started in
  5. // the selected language's corresponding directory.  The main reason for this
  6. // partitioning is so we can use Install Shield's localized resources per language
  7. // w/o burning separate versions of the distribution CD.  A non-english customer
  8. // will only see the initial setup and possibly the selection (only if his 95 system
  9. // is localized to a non supported language) in english.  Everything from then on
  10. // is displayed in the appropriate language.
  11.  
  12. declare
  13. // Code page id's for supported languages
  14. // The last 2 characters appear to stay the same regardless of language variations
  15.     #define    LKEY_ENGLISH        "09"
  16.     #define    LKEY_FRENCH            "0C"
  17. //    #define    LKEY_GERMAN            "07"
  18.     #define    LKEY_SWEDISH        "1D"
  19. //    #define    LKEY_ITALIAN        "10"
  20.     #define    LKEY_SPANISH        "0A"
  21.     #define    LKEY_POLISH            "15"
  22.     #define    LKEY_DUTCH            "13"
  23.  
  24. // Internal id's for supported languages
  25.     #define    LANG_ENGLISH        0
  26.     #define    LANG_FRENCH            1
  27. //    #define    LANG_GERMAN            2
  28.     #define    LANG_SWEDISH        3
  29. //    #define    LANG_ITALIAN        4
  30.     #define    LANG_SPANISH        5
  31.     #define    LANG_POLISH            6
  32.     #define    LANG_DUTCH            7
  33.  
  34. // FUNCTIONS
  35.     prototype    GetLocale();
  36.  
  37. //--------------------------------------------------------------------------------------------------
  38. //--------------------------------------------------------------------------------------------------
  39. //--------------------------------------------------------------------------------------------------
  40. //--------------------------------------------------------------------------------------------------
  41.  
  42. program
  43.     StartHere:
  44.         Disable( BACKGROUND );
  45.         Disable( BACKBUTTON );
  46.         Enable( DIALOGCACHE );
  47.  
  48.         Enable( HOURGLASS );
  49.  
  50.         switch (GetLocale())
  51.             case    LANG_ENGLISH:
  52.                 DoInstall( SRCDIR ^ "english\\setup.ins" , "" , NOWAIT );
  53.             case    LANG_FRENCH:
  54.                 DoInstall( SRCDIR ^ "french\\setup.ins" , "" , NOWAIT );
  55. //            case    LANG_GERMAN:
  56. //                DoInstall( SRCDIR ^ "german\\setup.ins" , "" , NOWAIT );
  57.             case    LANG_SWEDISH:
  58.                 DoInstall( SRCDIR ^ "swedish\\setup.ins" , "" , NOWAIT );
  59. //            case    LANG_ITALIAN:
  60. //                DoInstall( SRCDIR ^ "italian\\setup.ins" , "" , NOWAIT );
  61.             case    LANG_SPANISH:
  62.                 DoInstall( SRCDIR ^ "spanish\\setup.ins" , "" , NOWAIT );
  63.             case    LANG_POLISH:
  64.                 DoInstall( SRCDIR ^ "polish\\setup.ins" , "" , NOWAIT );
  65.             case    LANG_DUTCH:
  66.                 DoInstall( SRCDIR ^ "dutch\\setup.ins" , "" , NOWAIT );
  67.         endswitch;
  68. exit;
  69.  
  70. //--------------------------------------------------------------------------------------------------
  71. //--------------------------------------------------------------------------------------------------
  72. //--------------------------------------------------------------------------------------------------
  73. //--------------------------------------------------------------------------------------------------
  74.         
  75. function    GetLocale()
  76.     NUMBER    type, lang, length, retVal;
  77.     BOOL    isEnglish, isFrench, isGerman, isSwedish, isItalian, isSpanish, isPolish, isDutch;
  78.     STRING    regEntry;
  79. begin
  80.     lang = -1;
  81.  
  82.     RegDBSetDefaultRoot(HKEY_CURRENT_USER);
  83.  
  84.     if (RegDBGetKeyValueEx("\\Control Panel\\International", "Locale", type, regEntry, length) = 0) then
  85.         // read the language set from the registry
  86.         StrSub(regEntry, regEntry, length - 3, 4);
  87.  
  88.         if (StrCompare(regEntry, LKEY_ENGLISH) = 0) then
  89.             lang = LANG_ENGLISH;
  90.         elseif (StrCompare(regEntry, LKEY_FRENCH) = 0) then
  91.             lang = LANG_FRENCH;
  92. //        elseif (StrCompare(regEntry, LKEY_GERMAN) = 0) then
  93. //            lang = LANG_GERMAN;
  94.         elseif (StrCompare(regEntry, LKEY_SWEDISH) = 0) then
  95.             lang = LANG_SWEDISH;
  96. //        elseif (StrCompare(regEntry, LKEY_ITALIAN) = 0) then
  97. //            lang = LANG_ITALIAN;
  98.         elseif (StrCompare(regEntry, LKEY_SPANISH) = 0) then
  99.             lang = LANG_SPANISH;
  100.         elseif (StrCompare(regEntry, LKEY_POLISH) = 0) then
  101.             lang = LANG_POLISH;
  102.         elseif (StrCompare(regEntry, LKEY_DUTCH) = 0) then
  103.             lang = LANG_DUTCH;
  104.         endif;
  105.     endif;
  106.  
  107.     if (lang = -1) then
  108.         // not set to a supported language, so ask (in english)
  109.         isEnglish = TRUE;
  110.  
  111.         AskOptions( EXCLUSIVE, "Choose the language of the installation:",
  112.             "English", isEnglish,
  113.             "French", isFrench,
  114. //            "German" , isGerman,
  115.             "Swedish" , isSwedish,
  116. //            "Italian" , isItalian,
  117.             "Spanish" , isSpanish,
  118.             "Polish", isPolish,
  119.             "Dutch", isDutch);
  120.  
  121.         if (isEnglish) then
  122.             lang = LANG_ENGLISH;
  123.         elseif (isFrench) then
  124.             lang = LANG_FRENCH;
  125. //        elseif (isGerman) then
  126. //            lang = LANG_GERMAN;
  127.         elseif (isSwedish) then
  128.             lang = LANG_SWEDISH;
  129. //        elseif (isItalian) then
  130. //            lang = LANG_ITALIAN;
  131.         elseif (isSpanish) then
  132.             lang = LANG_SPANISH;
  133.         elseif (isPolish) then
  134.             lang = LANG_POLISH;
  135.         elseif (isDutch) then
  136.             lang = LANG_DUTCH;
  137.         endif;
  138.     endif;
  139.  
  140.     return lang;
  141. end;
  142.  
  143. //--------------------------------------------------------------------------------------------------
  144.