home *** CD-ROM | disk | FTP | other *** search
/ PC go! 1996 July / Image.iso / mrmore / mrmore.dir / 00003.ls < prev    next >
Encoding:
Text File  |  1996-04-11  |  11.0 KB  |  370 lines

  1. on DoItNow
  2.   global gsPopupType, gsPopupCont, gnMMSprite, gnPopupText
  3.   InitWaitWindow(gsPopupType, gsPopupCont)
  4.   StartMrMore(EMPTY, "more wait")
  5.   DoAnim(gnMMSprite, 9, 1)
  6.   InstallObject(gsPopupType, gsPopupCont)
  7.   if the castNum of sprite gnPopupText > 0 then
  8.     set s to the text of cast the castNum of sprite gnPopupText
  9.     put "100 %" into line 2 of s
  10.     set the text of cast the castNum of sprite gnPopupText to s
  11.   end if
  12.   DoAnim(gnMMSprite, 9, 1)
  13.   StopMrMore()
  14.   ClosePopup()
  15. end
  16.  
  17. on DoItLater
  18.   global gsPopupType, gsPopupCont, gnMMSprite, gnPopupText
  19.   set sType to gsPopupType
  20.   if sType = "soun" then
  21.     set sType to "Desi"
  22.   end if
  23.   set s to the text of field ("Install" & sType)
  24.   if s contains "Keine Daten gew├ñhlt" then
  25.     set s to EMPTY
  26.   end if
  27.   if s <> EMPTY then
  28.     set s to s & RETURN
  29.   end if
  30.   set the text of field ("Install" & sType) to s & gsPopupCont
  31. end
  32.  
  33. on DeInstallObject sType, sObject, sFileName
  34.   global goGBTools
  35.   put sType, sObject, sFileName
  36.   goGBTools(mDeleteProfileString, sType & "Ins", sObject, "mrmore.ini")
  37.   set file to FileIO(mnew, "read", sFileName)
  38.   if not objectp(file) then
  39.     exit
  40.   end if
  41.   file(mDelete)
  42. end
  43.  
  44. on InstallObject sType, sName
  45.   global gsDefPath
  46.   put sType, sName
  47.   if sName = EMPTY then
  48.     exit
  49.   end if
  50.   if sType = "font" then
  51.     InstallFont(sName, sType)
  52.   else
  53.     if sType = "game" then
  54.       InstallGame(sName)
  55.     else
  56.       if sType = "util" then
  57.         InstallUtil(sName)
  58.       else
  59.         if sType = "desi" then
  60.           if CheckDir(sType) then
  61.             InstallClip(gsDefPath & "gross\back\", the text of cast "desiDir", sName, sType)
  62.           end if
  63.         else
  64.           if sType = "soun" then
  65.             if CheckDir("desi") then
  66.               InstallSound(gsDefPath & "sounds\design\", the text of cast "desiDir", sName, sType)
  67.             end if
  68.           else
  69.             if sType = "back" then
  70.               if CheckDir("desi") then
  71.                 InstallClip(gsDefPath & "gross\back\", the text of cast "desiDir", sName, sType)
  72.               end if
  73.             else
  74.               if sType = "clip" then
  75.                 if CheckDir(sType) then
  76.                   InstallClip(gsDefPath & "clips\clip\", the text of cast "clipDir", sName, sType)
  77.                 end if
  78.               else
  79.                 if sType = "faxe" then
  80.                   if CheckDir(sType) then
  81.                     InstallClip(gsDefPath & "gross\faxe\", the text of cast "faxeDir", sName, sType)
  82.                   end if
  83.                 end if
  84.               end if
  85.             end if
  86.           end if
  87.         end if
  88.       end if
  89.     end if
  90.   end if
  91. end
  92.  
  93. on InstallEinkauf
  94.   global glInstallList, gnInstallActive, goGBTools, gnPopupText
  95.   if count(glInstallList) < 1 then
  96.     ClosePopup()
  97.     StopMrMore()
  98.     exit
  99.   end if
  100.   if gnInstallActive <> 0 then
  101.     if goGBTools(mIsActive, gnInstallActive) then
  102.       exit
  103.     else
  104.       set gnInstallActive to 0
  105.     end if
  106.   end if
  107.   set sCmd to getAt(glInstallList, 1)
  108.   set sCont to char 5 to length(sCmd) of sCmd
  109.   set s to "installiere: " & sCont & RETURN & " "
  110.   put string(100 / count(glInstallList)) & " %" into line 2 of s
  111.   set the text of cast the castNum of sprite gnPopupText to s
  112.   InstallObject(char 1 to 4 of sCmd, sCont)
  113.   set l to glInstallList
  114.   set n to count(l)
  115.   set glInstallList to list()
  116.   repeat with i = 2 to n
  117.     append(glInstallList, getAt(l, i))
  118.   end repeat
  119. end
  120.  
  121. on CheckDir sType
  122.   set sDir to the text of cast (sType & "Dir")
  123.   set sDir to alltrim(sDir)
  124.   if char length(sDir) of sDir <> "\" then
  125.     set sDir to sDir & "\"
  126.   end if
  127.   set the text of cast (sType & "Dir") to sDir
  128.   if not IsValidDir(sDir) then
  129.     if sType = "faxe" then
  130.       set s to "Fax"
  131.     else
  132.       if sType = "desi" then
  133.         set s to "Design"
  134.       else
  135.         if sType = "clip" then
  136.           set s to "Clip Art"
  137.         end if
  138.       end if
  139.     end if
  140.     ClosePopup()
  141.     set the text of cast "instDirTitle" to "Bitte geben Sie ein g├╝ltiges Zielverzeichnis f├╝r " & s & "-Dateien an!"
  142.     go("instDir")
  143.     return 0
  144.   end if
  145.   return 1
  146. end
  147.  
  148. on CheckForSpace sDir, nKB
  149.   global goGBTools
  150.   set n to goGBTools(mGetDriveSpace, sDir) / 1024
  151.   if n < nKB then
  152.     return 0
  153.   end if
  154.   return 1
  155. end
  156.  
  157. on IsValidDir sDir
  158.   if (sDir = EMPTY) or (sDir = "\") then
  159.     return 0
  160.   end if
  161.   set obj to FileIO(mnew, "write", sDir & "~mm~tst~.tmp")
  162.   if not objectp(obj) then
  163.     return 0
  164.   end if
  165.   if obj(mStatus) <> 0 then
  166.     obj(mdispose)
  167.     return 0
  168.   end if
  169.   obj(mDelete)
  170.   return 1
  171. end
  172.  
  173. on CheckForInstalled sType, sName
  174.   set sInstalled to ReadIni(sType & "Ins", sName, "MRMORE.INI")
  175.   put sInstalled
  176.   if sInstalled <> EMPTY then
  177.     return 1
  178.   else
  179.     return 0
  180.   end if
  181. end
  182.  
  183. on InstallClip sSourceDir, sDestDir, sName, sType
  184.   global goGBTools, gsDefPath
  185.   if CheckForInstalled(sType & "ins", sDestDir & sName) then
  186.     DoMrMore("fehler\bildinst", "more aktiv" & string(random(4)), 9, 0)
  187.     exit
  188.   end if
  189.   if not CheckForSpace(sDestDir, 300) then
  190.     DoMrMore("fehler\noplatz", "more aktiv" & string(random(4)), 9, 0)
  191.     exit
  192.   end if
  193.   set sSrc to sSourceDir & sName & ".bmp"
  194.   set sDest to sDestDir & sName & ".bmp"
  195.   put sSrc, sDest
  196.   set n to goGBTools(mCopyFile, sSrc, sDest)
  197.   if n = -1 then
  198.     DoMrMore("fehler\bildinst", "more aktiv" & string(random(4)), 9, 0)
  199.     exit
  200.   else
  201.     if n <= 0 then
  202.       if sType = "desi" then
  203.         InstallSound(gsDefPath & "sounds\design\", the text of cast "desiDir", sName, sType)
  204.       else
  205.         DoMrMore("fehler\bildcopy", "more aktiv" & string(random(4)), 9, 0)
  206.       end if
  207.       exit
  208.     else
  209.       WriteIni(sType & "ins", sName, sDest, "MRMORE.INI")
  210.     end if
  211.   end if
  212. end
  213.  
  214. on InstallSound sSourceDir, sDestDir, sName, sType
  215.   global goGBTools
  216.   if CheckForInstalled(sType & "ins", sDestDir & sName) then
  217.     DoMrMore("fehler\souninst", "more aktiv" & string(random(4)), 9, 0)
  218.     exit
  219.   end if
  220.   if not CheckForSpace(sDestDir, 205) then
  221.     DoMrMore("fehler\noplatz", "more aktiv" & string(random(4)), 9, 0)
  222.     exit
  223.   end if
  224.   set sSrc to sSourceDir & sName & ".wav"
  225.   set sDest to sDestDir & sName & ".wav"
  226.   set n to goGBTools(mCopyFile, sSrc, sDest)
  227.   if n = -1 then
  228.     DoMrMore("fehler\souninst", "more aktiv" & string(random(4)), 9, 0)
  229.     exit
  230.   else
  231.     if n <= 0 then
  232.       DoMrMore("fehler\souncopy", "more aktiv" & string(random(4)), 9, 0)
  233.       exit
  234.     end if
  235.   end if
  236.   WriteIni(sType & "ins", sName, sDest, "MRMORE.INI")
  237. end
  238.  
  239. on InstallGame sName
  240.   global goGBTools, gnInstallActive, gsDefPath
  241.   if sName = "Lemminge 3D" then
  242.     MsgBox("OK", "Mr. More", "Bitte beachten Sie, da├ƒ Lemminge 3D EMS-Speicher verwendet!" & RETURN & "Nach der Installation starten Sie bitte Lemminge 3D aus dem Programm-Manager.")
  243.     open("AEKDB", gsDefPath & "addl3d.exe")
  244.   else
  245.     if sName = "Lemminge Windows" then
  246.       MsgBox("OK", "Mr. More", "Das Installationsprogramm f├╝r Lemminge f├╝r Windows wird nun gestartet. " & "Bitte beachten Sie, da├ƒ der Mr. More Deinstaller f├╝r dieses Programm aus " & "technischen Gr├╝nden nicht aktiv ist." & RETURN & "Nach der Installation finden Sie die Lemminge-Gruppe im Start-Men├╝ unter 'Programme'." & RETURN & RETURN & "!! Achtung !!  Bei Compaq-Rechnern mit integriertem Soundsystem mu├ƒ gegebenenfalls das Inputsignal f├╝r WAV-Dateien im Programm CD-Sound-System in der Programmgruppe Media Pilot angehoben werden.")
  247.       goGBTools(mChDir, gsDefPath & "games\lwin")
  248.       set gnInstallActive to goGBTools(mExec, gsDefPath & "games\lwin\setup")
  249.     end if
  250.   end if
  251. end
  252.  
  253. on InstallUtil sName
  254.   global goGBTools, gnInstallActive, gsDefPath, gsWinDir
  255.   MsgBox("OK", "Mr. More", "Das Installationsprogramm f├╝r dieses Utility wird nun gestartet. " & "Bitte beachten Sie, da├ƒ der Mr. More Deinstaller f├╝r dieses Programm aus " & "technischen Gr├╝nden nicht aktiv ist.")
  256.   set sFile to alltrim(MakeUtilityFileName(sName))
  257.   goGBTools(mChDir, gsDefPath & "sharewa\" & sFile)
  258.   set sCmd to gsDefPath & "sharewa\" & sFile & "\" & line 1 of field sFile
  259.   set gnInstallActive to goGBTools(mExec, sCmd)
  260. end
  261.  
  262. on InstallFont sName
  263.   global gsWinDir, gsSysDir, goGBTools, gsDefPath
  264.   if CheckForInstalled("font", sName) then
  265.     DoMrMore("fehler\fontinst", "more aktiv" & string(random(4)), 9, 0)
  266.     exit
  267.   end if
  268.   if not CheckForSpace(gsWinDir, 70) then
  269.     DoMrMore("fehler\noplatz", "more aktiv" & string(random(4)), 9, 0)
  270.     exit
  271.   end if
  272.   set sFileName to MakeFontFileName(sName)
  273.   set oGlue to dllglue(mnew, "gdi.EXE", "AddFontResource", "I", "S")
  274.   if not CheckObject(oGlue, "Glue") then
  275.     quit()
  276.   end if
  277.   if GetWinVersion() = "3.95" then
  278.     set n to goGBTools(mCopyFile, gsDefPath & "fonts\" & sFileName & ".ttf", gsWinDir & "fonts\" & sFileName & ".ttf")
  279.     if n <= 0 then
  280.       if n = -1 then
  281.         DoMrMore("fehler\fontinst", "more aktiv" & string(random(4)), 9, 0)
  282.       else
  283.         DoMrMore("fehler\fontwrit", "more aktiv" & string(random(4)), 9, 0)
  284.       end if
  285.       oGlue(mdispose)
  286.       exit
  287.     end if
  288.     oGlue(mCall, gsWinDir & "fonts\" & sFileName & ".ttf")
  289.     WriteIni("FontIns", sName, gsWinDir & "fonts\" & sFileName & ".ttf", "MRMORE.INI")
  290.   else
  291.     WriteIni("fonts", sName & " (True Type)", sFileName & ".fot", "WIN.INI")
  292.     goGBTools(mCopyFile, gsDefPath & "fonts\" & sFileName & ".ttf", gsSysDir & sFileName & ".ttf")
  293.     set n to goGBTools(mCopyFile, gsDefPath & "fonts\" & sFileName & ".fot", gsSysDir & sFileName & ".fot")
  294.     if n <= 0 then
  295.       if n = -1 then
  296.         DoMrMore("fehler\fontinst", "more aktiv" & string(random(4)), 9, 0)
  297.       else
  298.         DoMrMore("fehler\fontwrit", "more aktiv" & string(random(4)), 9, 0)
  299.       end if
  300.       oGlue(mdispose)
  301.       exit
  302.     end if
  303.     put oGlue(mCall, sFileName & ".fot")
  304.     WriteIni("FontIns", sName, gsSysDir & sFileName & ".ttf", "MRMORE.INI")
  305.   end if
  306.   oGlue(mdispose)
  307. end
  308.  
  309. on MakeFontFileName sFont
  310.   set nWords to the number of words in sFont
  311.   set nLen to length(word 1 of sFont)
  312.   set sFileName to char 1 to 3 of word 1 of sFont
  313.   set sFileName to sFileName & char nLen - 1 to nLen of word 1 of sFont
  314.   if nWords > 2 then
  315.     set sFileName to sFileName & char 1 of word 2 of sFont
  316.   end if
  317.   set sFileName to sFileName & char 1 to 2 of word nWords of sFont
  318.   return sFileName
  319. end
  320.  
  321. on MakeUtilityFileName sUtil
  322.   set nLen to length(word 1 of sUtil)
  323.   if nLen > 6 then
  324.     return char 1 to 7 of sUtil
  325.   end if
  326.   set sFileName to char 1 to nLen of sUtil
  327.   set sFileName to sFileName & char nLen + 2 to 8 of sUtil
  328.   return sFileName
  329. end
  330.  
  331. on GetWinVersion
  332.   set oGetVer to dllglue(mnew, "KRNL386.EXE", "GetVersion", "U", "V")
  333.   if not objectp(oGetVer) or (not oGetVer(mStatus) = 0) then
  334.     alert("cannot determine Windows-Version!")
  335.     closeXLib("dllglue")
  336.     exit
  337.   end if
  338.   set n to oGetVer(mCall)
  339.   set nVersion to LoByte(LoWord(n))
  340.   set nRevision to HiByte(LoWord(n))
  341.   return string(nVersion) & "." & string(nRevision)
  342. end
  343.  
  344. on HiWord n
  345.   return n / 65536
  346. end
  347.  
  348. on LoWord n
  349.   return n mod 65536
  350. end
  351.  
  352. on HiByte n
  353.   return n / 256
  354. end
  355.  
  356. on LoByte n
  357.   return n mod 256
  358. end
  359.  
  360. on WriteIni sSection, sEntry, sValue, sFile
  361.   global goGBTools
  362.   set s to goGBTools(mWritePrivateProfileString, sSection, sEntry, sValue, sFile)
  363. end
  364.  
  365. on ReadIni sSection, sEntry, sFile
  366.   global goGBTools
  367.   set s to goGBTools(mGetPrivateProfileString, sSection, sEntry, sFile)
  368.   return s
  369. end
  370.