home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 12 / MA_Cover_12.iso / devs / hyperio-install-idc / install_hyperio < prev    next >
Encoding:
Text File  |  1998-12-24  |  49.2 KB  |  1,554 lines

  1. ;***************************************************************************************************
  2. ;***************************************************************************************************
  3. ;***
  4. ;***    hyperIO installation script
  5. ;***    ===========================
  6. ;***
  7. ;***    $VER: 1.0 (23.12.98)
  8. ;***
  9. ;***    ©1998 by Carsten 'michelangelo' Scholling
  10. ;***
  11. ;***
  12. ;***
  13. ;***    No changes outside of strings- and main-part!
  14. ;***
  15. ;***
  16. ;***************************************************************************************************
  17. ;***************************************************************************************************
  18.  
  19.  
  20. ;***************************************************************************************************
  21. ;***    Debugging stuff
  22. ;***************************************************************************************************
  23.  
  24.  
  25. ;***************************************************************************************************
  26. ;***    Error handling stuff
  27. ;***************************************************************************************************
  28. (onerror (P_Cleanup))
  29.  
  30.  
  31. ;***************************************************************************************************
  32. ;***    Configuration defaults
  33. ;***************************************************************************************************
  34. (set #prgname        "hyperIO")                    ;*** Simply the program name.
  35. (set #dirname        "hyperIO")                    ;*** Directory name to be created at first install.
  36.  
  37. (set #devspat        "hyper#?.device")            ;*** Devs hyperCOM/PAR file pattern
  38. (set #libspat        "vmc#?.library")            ;*** Libs VMC file pattern
  39. (set #devsisdnpat    "vmcisdn#?.device")            ;*** If this is found, some components should not be deleted!
  40.  
  41. (set #destdevs        "Devs:")                    ;*** Default device installation path. Primary needed for update check.
  42. (set #destlibs        "Libs:")                    ;*** Default libs installation path. Primary needed for update check.
  43. (set #destdocs        "Sys:Utilities")            ;*** Default documentation installation path.
  44. (set #destdocsdir    "hyperIO")                    ;*** Default utils directory.
  45. (set #destutil        "Sys:Utilities")            ;*** Default utils installation path.
  46. (set #destutildir    "hyperIO")                    ;*** Default utils directory.
  47. (set #destback        "SYS:Storage")                ;*** Default backup path.
  48. (set #destbackdir    "hyperIO_backup")            ;*** Default backup directory.
  49.  
  50. (set #minosver        36)                            ;*** Minimum OS version
  51. (set #mincpu        0)                            ;*** Minimum CPU.
  52.  
  53. (set #instchoice    0)                            ;*** Global installation choice (new, back, update, deinstall, end)
  54. (set #instparts        15)                            ;*** Bit mask of parts to install (0 = devs, 1 = libs, 2 = docs, 3 = utils)
  55. (set #instcards        127)                        ;*** Bit mask of cards to install drivers for (0 = hc1, 1 = hc3, 2 = hc3z, 3 = hc4, 4 = hc3ihc4, 5 = hc3ihc3z, 6 = hp)
  56. (set #instutil        63)                            ;*** Bit mask of utilities to install (0 = ncomm, 1 = ncomm-pk, 2 = hydra, 3 = porth. 4 = prtman, 5 = auxh.)
  57.  
  58. (set #vmchc1        "hyperCOM1.device")            ;***
  59. (set #vmchc3        "hyperCOM3.device")            ;***
  60. (set #vmchc4        "hyperCOM4?.device")        ;***
  61. (set #vmchc3z        "hyperCOM3?Z.device")        ;***
  62. (set #vmchp            "hyperPAR.device")            ;***
  63. (set #vmcrsc        "vmcresource.library")        ;***
  64.  
  65. (set #utilncomm        "ncomm306")                    ;***
  66. (set #utilncommpk    "NComm306PubKey")            ;***
  67. (set #utilhydra        "hydra")                    ;***
  68. (set #utilporth        "porthandler")                ;***
  69. (set #utilprtman    "prtman39")                    ;***
  70. (set #utilauxh        "auxhandler")                ;***
  71.  
  72.  
  73. ;***************************************************************************************************
  74. ;***    Strings
  75. ;***************************************************************************************************
  76.  
  77. ;***
  78. ;*** German strings
  79. ;***
  80. (if (= @language "deutsch") (
  81.  
  82.     (set #wronginstaller    (cat    "Achtung! Es ist eine alte Version des Programmes 'Installer' auf "
  83.                                     "Ihrem Amiga!\n\nDie Installation benötigt mindestens Installer "
  84.                                     "43.3.\n\nBitte überprüfen Sie Ihre Konfiguration!"))
  85.  
  86.     (set #msgmakedir                "Folgendes Verzeichnis wird nun erstellt: ")
  87.  
  88.     (set #msgdelete                    "\nFolgende Datei wird jetzt gelöscht:\n\n")
  89.  
  90.     (set #msgcopy                    "\nFolgende Datei wird jetzt kopiert:\n\n")
  91.  
  92.     (set #msgcopyover1        (cat    "\nEs wurde in der Quelldatei keine Versionsangabe gefunden.\nSoll diese Datei kopiert werden?\n\n"
  93.                                     "Zu installierende Datei: "))
  94.     (set #msgcopyover2                "\nBisher installierte Datei: ")
  95.     (set #msgcopyovernofile            "Bisher ist keine Datei installiert.")
  96.  
  97.     (set #msgwelcome1        (cat    "\nWillkommen zur \n\n" #prgname))
  98.     (set #msgwelcome2                " Installation.\n\n")
  99.  
  100.     (set #msgcopyright        (cat    "Copyright ©1992-1998 by VMC Harald Frank\n"
  101.                                     "<vmc@vmc.de>\n"
  102.                                     "http://www.vmc.de\n\n"
  103.                                     "Installer script ©1998 by Carsten 'michelangelo' Scholling\n"
  104.                                     "<cscholling@vmc.de>\n"))
  105.  
  106.     (set #msgoldinst        (cat    "Ich habe eine alte " #prgname " Installation auf Ihrem System gefunden.\n"
  107.                                     "Bitte wählen Sie, wie die Installation fortgesetzt werden soll.\n"))
  108.  
  109.     (set #msgoldfilesexp    (cat    "\n\n\nEs werden nun einige alte Dateien aus dem System entfernt.\n"
  110.                                     "Sie können im folgenden das Löschen jeder Datei einzeln bestätigen.\n"))
  111.  
  112.     (set #msgoldfilesave            "\n\n\nEs werden nun einige alte Dateien aus dem System entfernt.\n")
  113.  
  114.     (set #msgoldfiles2                "Bitte deselektieren Sie die Dateien/Verzeichnisse\ndie nicht gelöscht werden sollen:\n")
  115.  
  116.     (set #msgoldinstupdate            "Update der alten Version")
  117.     (set #msgoldinstnew                "Komplette Neuinstallation")
  118.     (set #msgoldinstback            "Backup anlegen, anschließend neu installieren")
  119.     (set #msgoldinstdeinst            "Alte Version deinstallieren")
  120.     (set #msgoldinstend                "Programm beenden")
  121.  
  122.     (set #msgwhichparts        (cat    "\nWelche Komponenten sollen installiert werden?\nAlle nicht selektierten Komponenten werden,\n"
  123.                                     "sofern vorhanden, automatisch deinstalliert!\n"))
  124.     (set #msgwhichdevs                "Devices")
  125.     (set #msgwhichlibs                "Libraries")
  126.     (set #msgwhichdocs                "Dokumentation")
  127.     (set #msgwhichutil                "Goodies")
  128.  
  129.     (set #msgworkingbackup            "\nErstelle ein Backup der alten Installation...\n")
  130.     (set #msgworkingsearchold        "\nSuche nach bereits installierten Komponenten... ;-)\n")
  131.     (set #msgworkingprepareinst        "\nBereite die Installation vor...\n")
  132.     (set #msgworkingpreparedeinst    "\nBereite die Deinstallation vor...\n")
  133.     (set #msgworkinginst            "\nArbeite an der Installation...\n")
  134.     (set #msgworkingdeinst            "\nArbeite an der Deinstallation...\n")
  135.  
  136.     (set #msguptodate        (cat    "Die zu installierende " #prgname " Version ist auf dem neusten Stand.\n"
  137.                                     "Bitte wählen Sie, ob Sie eine Neu- oder Deinstallation wünschen, oder\n"
  138.                                     "ob der Installer beendet werden soll.\n"))
  139.  
  140.     (set #msgaskdevs        (cat    "In welchem Verzeichnis sollen die Device-Treiber installiert werden?\n"
  141.                                     "Es wird KEIN Verzeichnis erstellt!\n"))
  142.     (set #msgasklibs        (cat    "In welchem Verzeichnis sollen die Bibliotheken installiert werden?\n"
  143.                                     "Es wird KEIN Verzeichnis erstellt!\n"))
  144.     (set #msgaskdocs        (cat    "In welchem Verzeichnis soll die Dokumentation installiert werden?\n"
  145.                                     "Es wird ein Verzeichnis " #destdocsdir " erstellt!\n"))
  146.     (set #msgaskutil        (cat    "In welchem Verzeichnis sollen die Goodies installiert werden?\n"
  147.                                     "Es wird ein Verzeichnis " #destutildir " erstellt!\n"))
  148.     (set #msgaskback        (cat    "In welchem Verzeichnis soll das Backup angelegt werden?\n"
  149.                                     "Es wird ein Verzeichnis " #destbackdir " erstellt!\n"))
  150.  
  151.     (set #msgconfirm        (cat    "\nDie folgenden Daten werden zur Installation herangezogen:\n"))
  152.     (set #msgconfirmdeinst    (cat    "\nDie folgenden Daten werden zur Deinstallation herangezogen:\n"))
  153.     (set #msgconfirmcpu                "\nProzessor: ")
  154.     (set #msgconfirmfpu                "\nFPU: ")
  155.     (set #msgconfirmos                "\nBetriebssystem: ")
  156.     (set #msgconfirmdevsdest        "\nDevices: ")
  157.     (set #msgconfirmlibsdest        "\nLibraries: ")
  158.     (set #msgconfirmdocsdest        "\nDokumentation: ")
  159.     (set #msgconfirmutildest        "\nGoodies: ")
  160.     (set #msgconfirmbackdest        "\nBackup: ")
  161.     (set #msgconfirmask                "\n\nSoll ich mit diesen Einstellungen fortfahren?\n")
  162.  
  163.     (set #msgdelrsclib        (cat    "\nAuf Ihrem System wurde eine VMC-ISDN Installation\n"
  164.                                     "gefunden welche auch die " #vmcrsc " benötigt.\n"
  165.                                     "Die installierte Version der " #vmcrsc "\n"
  166.                                     "ist neuer als die zu installierende Version.\n"
  167.                                     "Soll sie trotzdem gelöscht werden?\n"))
  168.  
  169.     (set #msgcardinst                "Bitte wählen Sie aus, welche Karten in\nIhrem System installiert sind.\n(Hilfe beachten!)")
  170.     (set #msgvmchc1d                "hyperCOM1 Karte")
  171.     (set #msgvmchc3d                "hyperCOM3 Karte")
  172.     (set #msgvmchc3z                "hyperCOM3z/hyperCOM3plus Karte")
  173.     (set #msgvmchc4d                "hyperCOM4/hyperCOM4plus Zorro Karte")
  174.     (set #msgvmchc3ihc4d            "hyperCOM3i installiert auf hyperCOM4")
  175.     (set #msgvmchc3ihc3zd            "hyperCOM3i installiert auf hyperCOM3z")
  176.     (set #msgvmchpd                    "hyperPAR.device für alle Karten")
  177.  
  178.     (set #msgcardinsthelp    (cat    "!!! NEU !!!\n\n"
  179.                                     "Eine hyperCOM3i welche auf einer hyperCOM4 montiert ist wird über das "
  180.                                     "hyperCOM4X.device auf Unit 4 und Unit 5 angesprochen.\n\n"
  181.                                     "Eine hyperCOM3i welche auf einer hyperCOM3z montiert ist wird über das "
  182.                                     "hyperCOM3Xz.device auf Unit 2 und Unit 3 angesprochen.\n\n"
  183.                                     "Alle parallelen Schnittstellen auf den hyperCOM-Karten werden grundsätzlich "
  184.                                     "über das hyperPAR.device angesteuert.\n\nDie LPT-Schnittstelle einer hyperCOM3 "
  185.                                     "im A1200 liegt immer auf Unit 0.\n"))
  186.  
  187.     (set #msgutilinst                "Bitte wählen Sie aus, welche der Goodie-Archive Sie kopieren möchten")
  188.     (set #msgutilncommd                "NComm V3.06 - Terminalprogramm")
  189.     (set #msgutilncommpkd            "Freies Keyfile für NComm")
  190.     (set #msgutilhydrad                "Hydra V1.0r9 - Bidirektionales Transferprotokoll")
  191.     (set #msgutilporthd                "PortHandler V41 - Ersatz für original PortHandler")
  192.     (set #msgutilprtmand            "PrintManager V39 - Drucker Spooler")
  193.     (set #msgutilauxhd                "Aux-Handler V2 - Ermöglicht Remote-Login")
  194.  
  195.     (set #msgutilinsthelp    (cat    "Achtung!\n\n"
  196.                                     "Die beigelegten Archive werden NICHT installiert sondern nur in das gewählte "
  197.                                     "Zielverzeichnis kopiert. Mit anderen Worten: Selbst ist die Frau/der Mann. "))
  198.  
  199.     (set #msgendinst        (cat    "\n" #prgname " Installation beendet!\n\n"))
  200.     (set #msgenddeinst        (cat    "\n" #prgname " Deinstallation beendet!\n\n"))
  201.     (set #msgend2            (cat    "\n" #prgname " Programm durch Benutzer beendet!\n\n"))
  202.  
  203.     (set #msgshowreadme                "\nSoll jetzt die Datei LiesMichZuerst.guide angezeigt werden?\n")
  204.  
  205.     (set #msgreboot                    "\nDer Rechner MUß nach dieser Installation neu gestartet\nwerden. Soll das jetzt geschehen?\n")
  206.     (set #msgrebootyes                "Reboot")
  207.     (set #msgrebootno                "KEIN Reboot")
  208. )
  209.  
  210. ;***
  211. ;*** English strings
  212. ;***
  213. (
  214.     (set #wronginstaller    (cat    "Attention! I found an old version og the programm 'Installer' on "
  215.                     "your Amiga!\n\nThe installation need at least Installer version "
  216.                     "43.3.\n\nPlease check your configuration!"))
  217.  
  218.     (set #msgmakedir        "The following dir will be created now: ")
  219.  
  220.     (set #msgdelete            "\nThe following file will be deletet now:\n\n")
  221.  
  222.     (set #msgcopy            "\nThe following file will be copied now:\n\n")
  223.  
  224.     (set #msgcopyover1    (cat    "\nI found no version info in the source file.\nShould i copy this file now?\n\n"
  225.                     "To installed file:     "))
  226.     (set #msgcopyover2        "\nActual installed file: ")
  227.     (set #msgcopyovernofile        "No file installed now.")
  228.  
  229.     (set #msgwelcome1    (cat    "\nWelcome to the\n\n" #prgname))
  230.     (set #msgwelcome2        " Installation.\n\n")
  231.  
  232.     (set #msgcopyright    (cat    "Copyright ©1992-1998 by VMC Harald Frank\n"
  233.                     "<vmc@vmc.de>\n"
  234.                     "http://www.vmc.de\n\n"
  235.                     "Installer script ©1998 by Carsten 'michelangelo' Scholling\n"
  236.                     "<cscholling@vmc.de>\n"))
  237.  
  238.     (set #msgoldinst    (cat    "I found an old " #prgname " Installation on your system.\n"
  239.                     "Please choose, how to continue the installation.\n"))
  240.  
  241.     (set #msgoldfilesexp    (cat    "\n\n\nI delete now some old files from your system.\n"
  242.                     "You can confirm the action for each file and dir.\n"))
  243.  
  244.     (set #msgoldfilesave        "\n\n\nI delete now some old files from your system.\n")
  245.  
  246.     (set #msgoldfiles2        "Please deselect all files/dirs,\nthat should not to be deleted:\n")
  247.  
  248.     (set #msgoldinstupdate        "Update the old version")
  249.     (set #msgoldinstnew        "Complete new installation")
  250.     (set #msgoldinstback        "Backup and install all new")
  251.     (set #msgoldinstdeinst        "Remove the installation")
  252.     (set #msgoldinstend        "Abort the installation")
  253.  
  254.     (set #msgwhichparts    (cat    "\nWhich components should to be installed?\nAll NOT selected components will be,\n"
  255.                     "if installed, automatically deinstalled!\n"))
  256.     (set #msgwhichdevs        "Devices")
  257.     (set #msgwhichlibs        "Libraries")
  258.     (set #msgwhichdocs        "Documentation")
  259.     (set #msgwhichutil        "Goodies")
  260.  
  261.     (set #msgworkingbackup        "\nCreate backup of the old installation...\n")
  262.     (set #msgworkingsearchold    "\nSearch actuall installed components... ;-)\n")
  263.     (set #msgworkingprepareinst    "\nPrepare the installation...\n")
  264.     (set #msgworkingpreparedeinst    "\nPrepare the deinstallation...\n")
  265.     (set #msgworkinginst        "\nWork on the installation...\n")
  266.     (set #msgworkingdeinst        "\nWork on the deinstallation...\n")
  267.  
  268.     (set #msguptodate    (cat    "The installed " #prgname " version is up to date.\n"
  269.                     "Please choose if you want an New- or Deinstallation, or\n"
  270.                     "if you want to quit the Installation.\n"))
  271.  
  272.     (set #msgaskdevs    (cat    "In which dir should i install the devices?\n"
  273.                     "No directory will be created!\n"))
  274.     (set #msgasklibs    (cat    "In which dir should i install the librarys?\n"
  275.                     "No directory will be created!\n"))
  276.     (set #msgaskdocs    (cat    "In which dir should i install the doc files?\n"
  277.                     "The " #destdocsdir " directory will be created!\n"))
  278.     (set #msgaskutil    (cat    "In which dir should i copy the goodies?\n"
  279.                     "The " #destutildir " directory will be created!\n"))
  280.     (set #msgaskback    (cat    "In which dir should i copy the backup files?\n"
  281.                     "The " #destbackdir " directory will be created!\n"))
  282.  
  283.     (set #msgconfirm    (cat    "\nThe follow information will be used by the installation:\n"))
  284.     (set #msgconfirmdeinst    (cat    "\nThe follow information will be used by the deinstallation:\n"))
  285.     (set #msgconfirmcpu        "\nCPU: ")
  286.     (set #msgconfirmfpu        "\nFPU: ")
  287.     (set #msgconfirmos        "\nOS-Type: ")
  288.     (set #msgconfirmdevsdest    "\nDevices: ")
  289.     (set #msgconfirmlibsdest    "\nLibraries: ")
  290.     (set #msgconfirmdocsdest    "\nDocumentation: ")
  291.     (set #msgconfirmutildest    "\nGoodies: ")
  292.     (set #msgconfirmbackdest    "\nBackup: ")
  293.     (set #msgconfirmask        "\n\nShould i use this settings?\n")
  294.  
  295.     (set #msgdelrsclib    (cat    "\nAuf Ihrem System wurde eine VMC-ISDN Installation\n"
  296.                     "gefunden welche auch die " #vmcrsc " benötigt.\n"
  297.                     "Die installierte Version der " #vmcrsc "\n"
  298.                     "ist neuer als die zu installierende Version.\n"
  299.                     "Schould i delete it?\n"))
  300.  
  301.     (set #msgcardinst        "Please choose the cards, that are installed in your Amiga.\n(See Help!)")
  302.     (set #msgvmchc1d        "HyperCOM1/PortJnr card")
  303.     (set #msgvmchc3d        "HyperCOM3/PortPlus card")
  304.     (set #msgvmchc3z        "HyperCOM3z/hyperCOM3plus Zorro card")
  305.     (set #msgvmchc4d        "HyperCOM4/hyperCOM4plus Zorro card")
  306.     (set #msgvmchc3ihc4d        "HyperCOM3i plugin on hyperCOM4")
  307.     (set #msgvmchc3ihc3zd        "HyperCOM3i plugin on hyperCOM3z")
  308.     (set #msgvmchpd            "hyperPAR.device for all HyperCOM's")
  309.  
  310.     (set #msgcardinsthelp    (cat    "!!! NEW !!!\n\n"
  311.                     "Eine hyperCOM3i welche auf einer hyperCOM4 montiert ist wird über das "
  312.                     "hyperCOM4X.device auf Unit 4 und Unit 5 angesprochen.\n\n"
  313.                     "Eine hyperCOM3i welche auf einer hyperCOM3z montiert ist wird über das "
  314.                     "hyperCOM3Xz.device auf Unit 2 und Unit 3 angesprochen.\n\n"
  315.                     "Alle parallelen Schnittstellen auf den hyperCOM-Karten werden grundsätzlich "
  316.                     "über das hyperPAR.device angesteuert.\n\nDie LPT-Schnittstelle einer hyperCOM3 "
  317.                     "im A1200 liegt immer auf Unit 0.\n"))
  318.  
  319.     (set #msgutilinst        "Please choose which part of the goodies you want to copy")
  320.     (set #msgutilncommd        "NComm V3.06 - Terminalsoftware")
  321.     (set #msgutilncommpkd        "Free & Public Keyfile for NComm")
  322.     (set #msgutilhydrad        "Hydra V1.0r9 - Bidirectional Transferprotokoll")
  323.     (set #msgutilporthd        "PortHandler V41 - Replacement for the old one")
  324.     (set #msgutilprtmand        "PrintManager V39 - Printer Spooler")
  325.     (set #msgutilauxhd        "Aux-Handler V2 - Shell over serial Remote-Login")
  326.  
  327.     (set #msgutilinsthelp    (cat    "Attention!\n\n"
  328.                     "The included goodies will NOT be installed, there is only an copy done, "
  329.                     "to the selected destination dir. Goodie-Installation is -> do it yourself. "))
  330.  
  331.     (set #msgendinst    (cat    "\n" #prgname " Installation done!\n\n"))
  332.     (set #msgenddeinst    (cat    "\n" #prgname " Deinstallation done!\n\n"))
  333.     (set #msgend2        (cat    "\n" #prgname " Installation aborted by user!\n\n"))
  334.  
  335.     (set #msgshowreadme        "\nDo you want to read the ReadMeeFirst.guide now?\n")
  336.  
  337.     (set #msgreboot            "\nYou MUST reboot after this installation to use\nthe new drivers. Should i reboot now?\n")
  338.     (set #msgrebootyes        "Reboot")
  339.     (set #msgrebootno        "No Reboot")
  340. ))
  341.  
  342.  
  343.  
  344. ;***************************************************************************************************
  345. ;***************************************************************************************************
  346. ;***
  347. ;***    !!! NO CHANGES BEHIND THIS LINE !!!
  348. ;***
  349. ;***************************************************************************************************
  350. ;***************************************************************************************************
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357. ;***************************************************************************************************
  358. ;***************************************************************************************************
  359. ;***
  360. ;***    Standard procedures
  361. ;***
  362. ;***************************************************************************************************
  363. ;***************************************************************************************************
  364.  
  365. ;***************************************************************************************************
  366. ;***    Procedure CheckOS
  367. ;***************************************************************************************************
  368. (procedure P_CheckOS
  369.     (set os    (/ (getversion "libs:version.library") 65536))
  370.  
  371.     (if (= os 37)    (set osname "2.0"))
  372.     (if (= os 38)    (set osname "2.1"))
  373.     (if (= os 39)    (set osname "3.0"))
  374.     (if (= os 40)    (set osname "3.1"))
  375.     (if (= os 41)    (set osname "3.5"))
  376.     (if (> os 41)    (set osname "3.5+ (not known)"))
  377.  
  378.     (if (>= os minosver)
  379.         (set ret 1)
  380.         (set ret 0)
  381.     )
  382. )
  383.  
  384.  
  385. ;***************************************************************************************************
  386. ;***    Procedure CheckCPU
  387. ;***************************************************************************************************
  388. (procedure P_CheckCPU
  389.     (set cpuname    (database "cpu"))
  390.     (set fpuname    (database "fpu"))
  391.  
  392.     (if (= cpuname "68000")    (set cpu 0))
  393.     (if (= cpuname "68010")    (set cpu 1))
  394.     (if (= cpuname "68020")    (set cpu 2))
  395.     (if (= cpuname "68030")    (set cpu 3))
  396.     (if (= cpuname "68040")    ((set cpu 4) (set fpuname "FPU040")))
  397.     (if (> (exists ("sys:libs/68060.library")) 0) (
  398.         (set cpuname "68060")
  399.         (set cpu 6)
  400.     ))
  401.  
  402.     (if (= fpuname "NOFPU")        (set fpu 0))
  403.     (if (= fpuname "68881")        (set fpu 1))
  404.     (if (= fpuname "68882")        (set fpu 2))
  405.     (if (= fpuname "FPU40")        (set fpu 4))
  406.     (if (= fpuname "FPU040")    (set fpu 4))
  407.     (if (> (exists ("sys:libs/68060.library")) 0) (
  408.         (set fpuname "FPU060")
  409.     ))
  410.  
  411.     (if (>= cpu mincpu)
  412.         (set ret 1)
  413.         (set ret 0)
  414.     )
  415. )
  416.  
  417.  
  418. ;***************************************************************************************************
  419. ;***    Procedure GetVersion <file>
  420. ;***************************************************************************************************
  421. (procedure P_GetVersion p_file
  422.     (set ver    (shiftright (BITAND (getversion p_file) $ffff0000) 16))
  423. )
  424.  
  425.  
  426. ;***************************************************************************************************
  427. ;***    Procedure GetRevision <file>
  428. ;***************************************************************************************************
  429. (procedure P_GetRevision p_file
  430.     (set rev    (BITAND (getversion p_file) $ffff))
  431. )
  432.  
  433.  
  434. ;***************************************************************************************************
  435. ;***    Procedure GetFullVersion <file>
  436. ;***************************************************************************************************
  437. (procedure P_GetFullVersion p_file
  438.     (set vers    (cat (P_GetVersion p_file ) "." (P_GetRevision p_file )))
  439. )
  440.  
  441.  
  442. ;***************************************************************************************************
  443. ;***    Procedure CheckExists <file>
  444. ;***************************************************************************************************
  445. (procedure P_CheckExists p_file
  446.     (set ret (exists p_file (noreq)))
  447. )
  448.  
  449.  
  450. ;***************************************************************************************************
  451. ;***    Procedure CheckExistsPat <path> <pattern>
  452. ;***************************************************************************************************
  453. (procedure P_CheckExistsPat p_path p_pat
  454.  
  455.     (set patexists 0)
  456.  
  457.     (if (P_CheckExists p_path) (
  458.  
  459.         (run (cat "list >t:csinstcheckpat.temp " p_path " pat " p_pat " lformat \"%n\""))
  460.  
  461.         (if (> (getsize "t:csinstcheckpat.temp") 0) (set patexists 1))
  462.  
  463.         (delete "t:csinstcheckpat.temp")
  464.     ))
  465.  
  466.     (set patexists patexists)
  467. )
  468.  
  469.  
  470. ;***************************************************************************************************
  471. ;***    Procedure Rename <file> <newname>
  472. ;***************************************************************************************************
  473. (procedure P_Rename p_file p_new p_conf
  474.     (if (= 2 @user-level)
  475.         (rename p_file p_new
  476.             (confirm)
  477.             (prompt (cat #msgrename1 p_file #msgrename2 p_new))
  478.             (help (cat #msgrename1 p_file #msgrename2 p_new))
  479.         )
  480.  
  481.         (rename p_file p_new)
  482.     )
  483. )
  484.  
  485.  
  486. ;***************************************************************************************************
  487. ;***    Procedure MakeDir <path> <name> <NOICONS>
  488. ;***************************************************************************************************
  489. (procedure P_MakeDir p_path p_name p_noicons
  490.  
  491.     (if (OR (> (P_CheckExists p_path) 0) (= p_name "")) (
  492.  
  493.         (set full (tackon p_path p_name))
  494.  
  495.         (if (< (P_CheckExists full) 2) (
  496.  
  497.             (if (= 2 @user-level)
  498.                 (if (= p_noicons "noicons")
  499.                     (makedir full
  500.                         (prompt (cat #msgmakedir full))
  501.                         (help (cat #msgmakedir full "\n\n" @makedir-help))
  502.                         (confirm)
  503.                     )
  504.                     (makedir full
  505.                         (prompt (cat #msgmakedir full))
  506.                         (help (cat #msgmakedir full "\n\n" @makedir-help))
  507.                         (confirm)
  508.                         (infos)
  509.                     )
  510.                 )
  511.                 (if (= p_noicons "icons")
  512.                     (makedir full
  513.                         (prompt (cat #msgmakedir full))
  514.                         (help (cat #msgmakedir full "\n\n" @makedir-help))
  515.                     )
  516.                     (makedir full
  517.                         (prompt (cat #msgmakedir full))
  518.                         (help (cat #msgmakedir full "\n\n" @makedir-help))
  519.                         (infos)
  520.                     )
  521.                 )
  522.             )
  523.         ))
  524.     ))
  525. )
  526.  
  527.  
  528. ;***************************************************************************************************
  529. ;***    Procedure Delete <file> <NOICONS> <NOREQ>
  530. ;***************************************************************************************************
  531. (procedure P_Delete p_file p_noicons p_noreq
  532.  
  533.     (if (= p_noreq "noreq") (
  534.  
  535.         (if (= p_noicons "noicons")
  536.             (delete p_file
  537.                 (prompt (cat #msgdelete p_file))
  538.                 (help (cat #msgdelete p_file))
  539.                 (optional "force" "askuser")
  540.                 (all)
  541.             )
  542.             (delete p_file
  543.                 (prompt (cat #msgdelete p_file))
  544.                 (help (cat #msgdelete p_file))
  545.                 (optional "force" "askuser")
  546.                 (all)
  547.             )
  548.         )
  549.     )
  550.     (
  551.         (if (= p_noicons "noicons")
  552.             (delete p_file
  553.                 (prompt (cat #msgdelete p_file))
  554.                 (help (cat #msgdelete p_file))
  555.                 (optional "force" "askuser")
  556.                 (confirm)
  557.                 (all)
  558.             )
  559.             (delete p_file
  560.                 (prompt (cat #msgdelete p_file))
  561.                 (help (cat #msgdelete p_file))
  562.                 (optional "force" "askuser")
  563.                 (confirm)
  564.                 (infos)
  565.                 (all)
  566.             )
  567.         )
  568.     ))
  569. )
  570.  
  571.  
  572. ;***************************************************************************************************
  573. ;***    Procedure SelectDir <default dest> <text> <helptext>
  574. ;***************************************************************************************************
  575. (procedure P_SelectDir p_dest p_text p_help
  576.  
  577.     ;*** Ask the user for any directory.
  578.     ;***
  579.     (set p_dest
  580.         (askdir
  581.             (prompt        p_text)
  582.             (help        (cat p_help "\n\n" @askdir-help))
  583.             (default    p_dest)
  584.         )
  585.     )
  586.  
  587.     (set p_dest p_dest)
  588. )
  589.  
  590.  
  591. ;***************************************************************************************************
  592. ;***    Procedure CopyNewer <source dir> <pattern> <dest dir>
  593. ;***************************************************************************************************
  594. (procedure P_CopyNewer p_srcdir p_pat p_destdir
  595.  
  596.     ;*** Compare the version/size
  597.     ;***
  598.     (foreach p_srcdir p_pat (
  599.  
  600.         (set res 1)
  601.  
  602.         ;*** Recursively call.
  603.         ;***
  604.         (if (= 2 (P_CheckExists (tackon p_srcdir @each-name)))
  605.         (
  606.             (P_MakeDir p_destdir @each-name "icons")
  607.  
  608.             (set savesrc    p_srcdir)
  609.             (set savepat    p_pat)
  610.             (set savedest    p_destdir)
  611.  
  612.             (P_CopyNewer (tackon p_srcdir @each-name) "#?" (tackon p_destdir @each-name))
  613.  
  614.             (set p_srcdir    savesrc)
  615.             (set p_pat        savepat)
  616.             (set p_destdir    savedest)
  617.         )
  618.         (
  619.             ;*** Get the two version numbers.
  620.             ;***
  621.             (if (= 0 (getversion (tackon p_srcdir @each-name)))
  622.             (
  623.                 (set srcvers (cat "  (" (/ (getsize (tackon p_srcdir @each-name)) 1024) "kB)"))
  624.  
  625.                 (if ((P_CheckExists (tackon p_destdir @each-name)))
  626.                 (
  627.                     (set destname @each-name)
  628.                     (set msgcopyover2 #msgcopyover2)
  629.  
  630.                     (if (= 0 (getversion (tackon p_destdir @each-name)))
  631.                         (set destvers (cat "  (" (/ (getsize (tackon p_destdir @each-name)) 1024) "kB)"))
  632.                         (set destvers (cat (P_GetFullVersion (tackon p_destdir @each-name)) "  (" (/ (getsize (tackon p_destdir @each-name)) 1024) "kB)"))
  633.                     )
  634.                 )
  635.                 (
  636.                     (set destname #msgcopyovernofile)
  637.                     (set destvers "")
  638.                     (set msgcopyover2 "\n")
  639.                 ))
  640.  
  641.                 (set res (askbool
  642.                     (prompt        (cat #msgcopyover1 @each-name " " srcvers msgcopyover2 destname " " destvers))
  643.                     (help        (cat #msgcopyover1 @each-name " " srcvers msgcopyover2 destname " " destvers))
  644.                     (default    1)
  645.                 ))
  646.  
  647.                 (if (= 1 res) (
  648.                     (copyfiles
  649.                         (prompt #msgcopy)
  650.                         (help (cat #msgcopy @copyfiles-help))
  651.                         (source    p_srcdir)
  652.                         (dest    p_destdir)
  653.                         (pattern @each-name)
  654.                         (infos)
  655.                     )
  656.                 ))
  657.             )
  658.             (
  659.                 (if (= 2 @user-level)
  660.                     (copylib
  661.                         (prompt (cat #msgcopy @each-name))
  662.                         (help (cat #msgcopy @each-name "\n\n" @copylib-help))
  663.                         (source    (tackon p_srcdir @each-name))
  664.                         (dest     p_destdir)
  665.                         (confirm)
  666.                         (infos)
  667.                     )
  668.                     (copylib
  669.                         (prompt (cat #msgcopy @each-name))
  670.                         (help (cat #msgcopy @each-name "\n\n" @copylib-help))
  671.                         (source    (tackon p_srcdir @each-name))
  672.                         (dest     p_destdir)
  673.                         (infos)
  674.                     )
  675.                 )
  676.             ))
  677.         ))
  678.     ))
  679. )
  680.  
  681.  
  682. ;***************************************************************************************************
  683. ;***    Procedure CopyNewerExists
  684. ;***************************************************************************************************
  685. (procedure P_CopyNewerExists p_srcdir p_pat p_destdir
  686.  
  687.     (if (P_CheckExistsPat p_destdir p_pat) (P_CopyNewer p_srcdir p_pat p_destdir))
  688. )
  689.  
  690.  
  691.  
  692.  
  693. ;***************************************************************************************************
  694. ;***    Procedure PreInstall
  695. ;***************************************************************************************************
  696. (procedure P_PreInstall
  697.  
  698.     (set @default-dest (tackon #destdocs #destdocsdir))
  699. )
  700.  
  701.  
  702. ;***************************************************************************************************
  703. ;***    Procedure Welcome
  704. ;***************************************************************************************************
  705. (procedure P_About p_update
  706.  
  707. ;    (set date (getenv (tackon (pathonly @icon) "hyperIOVersion")))
  708. ;    (set ver            (/ vers 65536))
  709. ;    (set rev            (- vers (* ver 65536)))
  710. ;    (set version        (cat ver "." rev))
  711.  
  712. ;    (message (cat #msgwelcome1 " " version #msgwelcome2 #msgcopyright))
  713.     (message (cat #msgwelcome1 #msgwelcome2 #msgcopyright))
  714. )
  715.  
  716.  
  717. ;***************************************************************************************************
  718. ;***    Procedure CheckOldInst
  719. ;***************************************************************************************************
  720. (procedure P_CheckOldInst
  721.  
  722.     (set ret 1)
  723.  
  724.     (working #msgworkingsearchold)
  725.  
  726.     ;*** Check for a version file in devs:
  727.     ;***
  728.     (if (= 0 (P_CheckExists (tackon #destdevs "hyperIOVersion")))
  729.     (
  730.         (set patcnt 0)
  731.  
  732.         ;*** Search for devices and libs (resource lib does not bother if isdn installed)
  733.         ;***
  734.         (if (P_CheckExistsPat #destdevs #devspat) (set patcnt (+ 1 patcnt)))
  735.         (if (AND (P_CheckExistsPat #destlibs #libspat) (= 0 (P_CheckExistsPat #destdevs #devsisdnpat))) (set patcnt (+ 1 patcnt)))
  736.         (if (P_CheckExistsPat (tackon #destdocs #destdocsdir) "(Documentaion|Dokumentation)") (set patcnt (+ 1 patcnt)))
  737.         (if (P_CheckExistsPat (tackon #destutil #destutildir) "Goodies") (set patcnt (+ 1 patcnt)))
  738.  
  739.         ;*** Found some very old files
  740.         ;***
  741.         (if (> patcnt 0)
  742.         (
  743.             (set ret 2)
  744.  
  745.             ;*** Let the user select what to do (update, install new).
  746.             ;***
  747.             (set    #instchoice
  748.                 (askchoice
  749.                     (prompt        #msgoldinst)
  750.                     (help        (cat #msgoldinst "\n\n" @askchoice-help))
  751.                     (choices    #msgoldinstnew #msgoldinstback #msgoldinstdeinst #msgoldinstend)
  752.                     (default    0)
  753.                 )
  754.             )
  755.  
  756.             ;*** Add 1 to the choice (If very old, no update possible!)
  757.             ;***
  758.             (set #instchoice (+ 1 #instchoice))
  759.         )
  760.         (
  761.             ;*** No previous installation found! Install new.
  762.             ;***
  763.             (set #instchoice 1)
  764.             (set ret 3)
  765.         ))
  766.     )
  767.     (
  768.         ;*** Else, we look vor the verion number
  769.         ;*** coded as version=high-byte and revision=low-byte.
  770.         ;***
  771.         (set oldvers (getenv (tackon #destdevs "hyperIOVersion")))
  772.         (set newvers (getenv (tackon (pathonly @icon) "hyperIOVersion")))
  773.  
  774.         (if (< oldvers newvers) (
  775.  
  776.             ;*** Let the user select what to do (update, install new).
  777.             (set    #instchoice
  778.                 (askchoice
  779.                     (prompt        #msgoldinst)
  780.                     (help        (cat #msgoldinst "\n\n" @askchoice-help))
  781.                     (choices    #msgoldinstupdate #msgoldinstnew #msgoldinstback #msgoldinstdeinst #msgoldinstend)
  782.                     (default    0)
  783.                 }
  784.             ))
  785.         )
  786.         (
  787.             (set ret 1)
  788.  
  789.             ;*** All files up to date. May the user want to deinstall the files...
  790.             (set    choice
  791.                 (askchoice
  792.                     (prompt        #msguptodate)
  793.                     (help        (cat #msguptodate "\n\n" @askchoice-help))
  794.                     (choices    #msgoldinstnew #msgoldinstdeinst #msgoldinstend)
  795.                     (default    0)
  796.                 }
  797.             ))
  798.  
  799.             (if (= 0 choice)
  800.                 (set #instchoice 1)
  801.  
  802.                 (if (= 1 choice)
  803.                     (set #instchoice 3)
  804.  
  805.                     (if (= 2 choice)
  806.                         (set #instchoice 4)
  807.                     )
  808.                 )
  809.             )
  810.         ))
  811.     ))
  812.  
  813.     ;*** We have to cancel (end) the installation script
  814.     ;***
  815.     (if (= 4 #instchoice) (set ret 0))
  816.  
  817.     (set ret ret)
  818. )
  819.  
  820.  
  821. ;***************************************************************************************************
  822. ;***    Procedure PrepareInstall
  823. ;***************************************************************************************************
  824. (procedure P_PrepareInstall
  825.  
  826.     ;*** Only ask, if not deinstallation.
  827.     ;***
  828.     (if (<> 3 #instchoice) (
  829.  
  830.         ;*** Let the user select which parts of the software should be installed
  831.         ;***
  832.         (set #instparts
  833.             (askoptions
  834.                 (prompt        #msgwhichparts)
  835.                 (help        (cat #msgwhichparts "\n\n" @askchoice-help))
  836.                 (choices    #msgwhichdevs #msgwhichlibs #msgwhichdocs #msgwhichutil)
  837.                 (default    #instparts)
  838.             }
  839.         ))
  840.  
  841.         ;*** Let the user select which cards are installed and which utils should be installed (if NO update)
  842.         ;***
  843.         (if (<> 0 #instchoice) (
  844.             (if (IN #instparts 0)
  845.                 (set    #instcards
  846.                     (askoptions
  847.                         (prompt        #msgcardinst)
  848.                         (help        (cat #msgcardinsthelp "\n\n" @askoptions-help))
  849.                         (choices    #msgvmchc1d #msgvmchc3d #msgvmchc3z #msgvmchc4d #msgvmchc3ihc4d #msgvmchc3ihc3zd #msgvmchpd)
  850.                         (default    #instcards)
  851.                     )
  852.                 )
  853.                 (set #instcards 0)
  854.             )
  855.  
  856.             (if (IN #instparts 3)
  857.                 (set    #instutil
  858.                     (askoptions
  859.                         (prompt        #msgutilinst)
  860.                         (help        (cat #msgutilinsthelp "\n\n" @askoptions-help))
  861.                         (choices    #msgutilncommd #msgutilncommpkd #msgutilhydrad #msgutilporthd #msgutilprtmand #msgutilauxhd)
  862.                         (default    #instutil)
  863.                     )
  864.                 )
  865.                 (set #instutil 0)
  866.             )
  867.         ))
  868.  
  869.         ;*** Ask for the destination dirs depending on selected parts
  870.         ;***
  871.         (if (IN #instparts 0) (set #destdevs (P_SelectDir #destdevs #msgaskdevs #msgaskdevs)))
  872.         (if (IN #instparts 1) (set #destlibs (P_SelectDir #destlibs #msgasklibs #msgasklibs)))
  873.         (if (IN #instparts 2) (set #destdocs (P_SelectDir #destdocs #msgaskdocs #msgaskdocs)))
  874.         (if (IN #instparts 3) (set #destutil (P_SelectDir #destutil #msgaskutil #msgaskutil)))
  875.  
  876.         ;*** Let the user select a backup dir if backup selected
  877.         ;***
  878.         (if (= 2 #instchoice) (set #destback (P_SelectDir #destback #msgaskback #msgaskback)))
  879.     ))
  880. )
  881.  
  882.  
  883. ;***************************************************************************************************
  884. ;***    Procedure AskConfirmation
  885. ;***************************************************************************************************
  886. (procedure P_AskConfirmation
  887.  
  888.     (set msgconfirm2 "")
  889.  
  890.     (if (<> 3 #instchoice)
  891.     (
  892.         (set msgconfirm1    (cat    #msgconfirm
  893.                                     #msgconfirmcpu    cpuname
  894.                                     #msgconfirmfpu    fpuname
  895.                                     #msgconfirmos    osname
  896.                                     "\n"))
  897.  
  898.         (if (IN #instparts 0) (set msgconfirm2 (cat msgconfirm2 #msgconfirmdevsdest #destdevs)))
  899.         (if (IN #instparts 1) (set msgconfirm2 (cat msgconfirm2 #msgconfirmlibsdest #destlibs)))
  900.         (if (IN #instparts 2) (set msgconfirm2 (cat msgconfirm2 #msgconfirmdocsdest (tackon #destdocs #destdocsdir))))
  901.         (if (IN #instparts 3) (set msgconfirm2 (cat msgconfirm2 #msgconfirmutildest (tackon #destutil #destutildir))))
  902.     )
  903.     (
  904.  
  905.         (set msgconfirm1            #msgconfirmdeinst)
  906.  
  907.         (set msgconfirm2    (cat    #msgconfirmdevsdest    #destdevs
  908.                                     #msgconfirmlibsdest    #destlibs
  909.                                     #msgconfirmdocsdest    (tackon #destdocs #destdocsdir)
  910.                                     #msgconfirmutildest    (tackon #destutil #destutildir)))
  911.  
  912.     ))
  913.  
  914.  
  915.     (if (= 2 #instchoice)
  916.         (set msgconfirm3    (cat    #msgconfirmbackdest (tackon #destback #destbackdir)))
  917.     )
  918.  
  919.     (set msgconfirm            (cat    msgconfirm1 msgconfirm2 msgconfirm3 #msgconfirmask))
  920.  
  921.     ;*** All right?
  922.     (set    choice
  923.         (askbool
  924.             (prompt        msgconfirm)
  925.             (help        msgconfirm)
  926.             (default    1)
  927.         )
  928.     )
  929.  
  930.     (set @default-dest (tackon #destdocs #destdocsdir))
  931.  
  932.     (set choice choice)
  933. )
  934.  
  935.  
  936.  
  937. ;***************************************************************************************************
  938. ;***    Procedure SetupInstall
  939. ;***************************************************************************************************
  940. (procedure P_SetupInstall
  941.  
  942.     (if (<> 3 #instchoice) (working #msgworkingprepareinst) (working #msgworkingpreparedeinst))
  943.  
  944.     (if (= 0 #instchoice) (
  945.         (P_PreUpdate)
  946.     ))
  947.  
  948.     (if (= 1 #instchoice) (
  949.         (P_PreDeInstall)
  950.         (P_PreNewInstall)
  951.     ))
  952.  
  953.     (if (= 2 #instchoice) (
  954.         (P_PreNewInstall)
  955.     ))
  956.  
  957.     (if (= 3 #instchoice) (
  958.         (P_PreDeInstall)
  959.     ))
  960. )
  961.  
  962.  
  963. ;***************************************************************************************************
  964. ;***    Procedure DoInstall
  965. ;***************************************************************************************************
  966. (procedure P_DoInstall
  967.  
  968.     (if (<> 3 #instchoice) (working #msgworkinginst) (working #msgworkingdeinst))
  969.  
  970.     (if (= 0 #instchoice) (
  971.         (P_DoUpdate)
  972.     ))
  973.  
  974.     (if (= 1 #instchoice) (
  975.         (P_DeInstall)
  976.         (P_NewInstall)
  977.     ))
  978.  
  979.     (if (= 2 #instchoice) (
  980.         (P_Backup)
  981.         (P_NewInstall)
  982.     ))
  983.  
  984.     (if (= 3 #instchoice) (
  985.         (P_DeInstall)
  986.     ))
  987. )
  988.  
  989.  
  990.  
  991. ;***************************************************************************************************
  992. ;***    Procedure PreUpdate
  993. ;***************************************************************************************************
  994. (procedure P_PreUpdate
  995.  
  996. )
  997.  
  998.  
  999. ;***************************************************************************************************
  1000. ;***    Procedure DoUpdate
  1001. ;***************************************************************************************************
  1002. (procedure P_DoUpdate
  1003.  
  1004.     ;*** Define the source dirs
  1005.     ;***
  1006.     (set srcdir (pathonly @icon))
  1007.     (set srcdirdevs (tackon srcdir "devs"))
  1008.     (set srcdirlibs (tackon srcdir "libs"))
  1009.     (set srcdirdocs (tackon srcdir "docs"))
  1010.     (set srcdirutil (tackon srcdir "goodies"))
  1011.  
  1012.     ;*** Now copy the files always needed
  1013.     ;***
  1014.  
  1015.     ;*** Copy the selected drivers.
  1016.     ;***
  1017.     (if (IN #instparts 0) (
  1018.  
  1019.         (set copycard 0)
  1020.         (set copiedcards 0)
  1021.         (set instcards #instcards)
  1022.  
  1023.         (if (AND (IN instcards 2) (IN instcards 5)) (set instcards (- instcards 32)))
  1024.         (if (AND (IN instcards 3) (IN instcards 4)) (set instcards (- instcards 16)))
  1025.  
  1026.         (while (< copycard 7) (
  1027.  
  1028.             (if (IN instcards copycard) (
  1029.  
  1030.                 (if (= copycard 0)                        (set cardpat #vmchc1))
  1031.                 (if (= copycard 1)                        (set cardpat #vmchc3))
  1032.                 (if (OR (= copycard 2) (= copycard 5))    (set cardpat #vmchc3z))
  1033.                 (if (OR (= copycard 3) (= copycard 4))    (set cardpat #vmchc4))
  1034.                 (if (= copycard 6)                        (set cardpat #vmchp))
  1035.  
  1036.                 (if (NOT (IN copiedcards copycard))    (
  1037.                     (set copiedcards (BITOR copiedcards (shiftleft 1 copycard)))
  1038.                     (P_CopyNewerExists srcdirdevs cardpat #destdevs)
  1039.                 ))
  1040.             ))
  1041.  
  1042.             (set copycard (+ 1 copycard))
  1043.         ))
  1044.     ))
  1045.  
  1046.  
  1047.     ;*** resource library
  1048.     ;***
  1049.     (if (IN #instparts 1) (P_CopyNewerExists srcdirlibs #vmcrsc #destlibs))
  1050.  
  1051.     ;*** documentation
  1052.     ;***
  1053.     (P_MakeDir #destdocs #destdocsdir "icons")
  1054.     (if (IN #instparts 2) (P_CopyNewerExists srcdirdocs "#?" (tackon #destdocs #destdocsdir)))
  1055.  
  1056.     ;*** Goodies
  1057.     ;***
  1058.     (if (IN #instparts 3) (
  1059.  
  1060.         (P_MakeDir #destutil #destutildir "icons")
  1061.         (P_MakeDir (tackon #destutil #destutildir) "Goodies" "icons")
  1062.  
  1063.         (if (IN #instutil 0) (P_CopyNewerExists srcdirutil (cat #utilncomm "#?")    (tackon (tackon #destutil #destutildir) "Goodies")))
  1064.         (if (IN #instutil 1) (P_CopyNewerExists srcdirutil (cat #utilncommpk "#?")    (tackon (tackon #destutil #destutildir) "Goodies")))
  1065.         (if (IN #instutil 2) (P_CopyNewerExists srcdirutil (cat #utilhydra "#?")    (tackon (tackon #destutil #destutildir) "Goodies")))
  1066.         (if (IN #instutil 3) (P_CopyNewerExists srcdirutil (cat #utilporth "#?")    (tackon (tackon #destutil #destutildir) "Goodies")))
  1067.         (if (IN #instutil 4) (P_CopyNewerExists srcdirutil (cat #utilprtman "#?")    (tackon (tackon #destutil #destutildir) "Goodies")))
  1068.         (if (IN #instutil 5) (P_CopyNewerExists srcdirutil (cat #utilauxh "#?")        (tackon (tackon #destutil #destutildir) "Goodies")))
  1069.     ))
  1070.  
  1071.     ;*** Version ID file
  1072.     ;***
  1073.     (copyfiles 
  1074.         (source (tackon srcdir "hyperIOVersion"))
  1075.         (dest #destdevs)
  1076.         (nogauge)
  1077.         (files)
  1078.     )
  1079. )
  1080.  
  1081.  
  1082. ;***************************************************************************************************
  1083. ;***    Procedure PreNewInstall
  1084. ;***************************************************************************************************
  1085. (procedure P_PreNewInstall
  1086.  
  1087. )
  1088.  
  1089.  
  1090. ;***************************************************************************************************
  1091. ;***    Procedure NewInstall
  1092. ;***************************************************************************************************
  1093. (procedure P_NewInstall
  1094.  
  1095.     ;*** Define the source dirs
  1096.     ;***
  1097.     (set srcdir (pathonly @icon))
  1098.     (set srcdirdevs (tackon srcdir "devs"))
  1099.     (set srcdirlibs (tackon srcdir "libs"))
  1100.     (set srcdirdocs (tackon srcdir "docs"))
  1101.     (set srcdirutil (tackon srcdir "goodies"))
  1102.  
  1103.     ;*** Now copy the files always needed
  1104.     ;***
  1105.  
  1106.     ;*** Copy the selected drivers.
  1107.     ;***
  1108.     (if (IN #instparts 0) (
  1109.  
  1110.         (set copycard 0)
  1111.         (set copiedcards 0)
  1112.  
  1113.         (while (< copycard 7) (
  1114.  
  1115.             (if (IN #instcards copycard) (
  1116.  
  1117.                 (if (= copycard 0)                        (set cardpat #vmchc1))
  1118.                 (if (= copycard 1)                        (set cardpat #vmchc3))
  1119.                 (if (OR (= copycard 2) (= copycard 5))    (set cardpat #vmchc3z))
  1120.                 (if (OR (= copycard 3) (= copycard 4))    (set cardpat #vmchc4))
  1121.                 (if (= copycard 6)                        (set cardpat #vmchp))
  1122.  
  1123.                 (if (NOT (IN copiedcards copycard))    (
  1124.                     (set copiedcards (BITOR copiedcards (shiftleft 1 copycard)))
  1125.                     (P_CopyNewer srcdirdevs cardpat #destdevs)
  1126.                 ))
  1127.             ))
  1128.  
  1129.             (set copycard (+ 1 copycard))
  1130.         ))
  1131.     ))
  1132.  
  1133.  
  1134.     ;*** resource library
  1135.     ;***
  1136.     (if (IN #instparts 1) (P_CopyNewer srcdirlibs #vmcrsc #destlibs))
  1137.  
  1138.     ;*** documentation
  1139.     ;***
  1140.     (P_MakeDir #destdocs #destdocsdir "icons")
  1141.     (if (IN #instparts 2) (P_CopyNewer srcdirdocs "#?" (tackon #destdocs #destdocsdir)))
  1142.  
  1143.     ;*** Goodies
  1144.     ;***
  1145.     (if (IN #instparts 3) (
  1146.  
  1147.         (P_MakeDir #destutil #destutildir "icons")
  1148.         (P_MakeDir (tackon #destutil #destutildir) "Goodies" "icons")
  1149.  
  1150.         (if (IN #instutil 0) (P_CopyNewer srcdirutil (cat #utilncomm "#?")        (tackon (tackon #destutil #destutildir) "Goodies")))
  1151.         (if (IN #instutil 1) (P_CopyNewer srcdirutil (cat #utilncommpk "#?")    (tackon (tackon #destutil #destutildir) "Goodies")))
  1152.         (if (IN #instutil 2) (P_CopyNewer srcdirutil (cat #utilhydra "#?")        (tackon (tackon #destutil #destutildir) "Goodies")))
  1153.         (if (IN #instutil 3) (P_CopyNewer srcdirutil (cat #utilporth "#?")        (tackon (tackon #destutil #destutildir) "Goodies")))
  1154.         (if (IN #instutil 4) (P_CopyNewer srcdirutil (cat #utilprtman "#?")        (tackon (tackon #destutil #destutildir) "Goodies")))
  1155.         (if (IN #instutil 5) (P_CopyNewer srcdirutil (cat #utilauxh "#?")        (tackon (tackon #destutil #destutildir) "Goodies")))
  1156.     ))
  1157.  
  1158.     ;*** Version ID file
  1159.     ;***
  1160.     (copyfiles
  1161.         (source (tackon srcdir "hyperIOVersion"))
  1162.         (dest #destdevs)
  1163.         (nogauge)
  1164.         (files)
  1165.     )
  1166. )
  1167.  
  1168.  
  1169. ;***************************************************************************************************
  1170. ;***    Procedure Backup
  1171. ;***************************************************************************************************
  1172. (procedure P_Backup
  1173.  
  1174.     (working #msgworkingbackup)
  1175.  
  1176.     ;*** Create all needed dirs
  1177.     ;***
  1178.     (P_MakeDir #destback "" "icons")
  1179.     (P_MakeDir #destback #destbackdir "icons")
  1180.  
  1181.  
  1182.     ;*** Backup version information file
  1183.     ;***
  1184.     (if (P_CheckExists (tackon #destdevs "hyperIOVersion")) (
  1185.  
  1186.         (copyfiles
  1187.             (source (tackon #destdevs "hyperIOVersion"))
  1188.             (dest (tackon #destback #destbackdir))
  1189.             (nogauge)
  1190.             (files)
  1191.         )
  1192.  
  1193.         (P_Delete (tackon #destdevs "hyperIOVersion") "noicons" "noreq")
  1194.     ))
  1195.  
  1196.  
  1197.     ;*** Backup Devs drawer
  1198.     ;***
  1199.     (foreach #destdevs #devspat (
  1200.  
  1201.         (copyfiles
  1202.             (source (tackon #destdevs @each-name))
  1203.             (dest (tackon (tackon #destback #destbackdir) "devs"))
  1204.             (nogauge)
  1205.             (files)
  1206.         )
  1207.  
  1208.         (P_Delete (tackon #destdevs @each-name) "icons" "req")
  1209.     ))
  1210.  
  1211.  
  1212.     ;*** Backup Libs drawer
  1213.     ;***
  1214.     (foreach #destlibs #libspat (
  1215.  
  1216.         (copylib
  1217.             (source (tackon #destlibs @each-name))
  1218.             (dest (tackon (tackon #destback #destbackdir) "libs"))
  1219.             (nogauge)
  1220.         )
  1221.  
  1222.         ;*** Don't delete any library if isdn installed!
  1223.         ;***
  1224.         (if (= 0 (P_CheckExistsPat #destdevs #devsisdnpat)) (P_Delete (tackon #destlibs @each-name) "icons" "req"))
  1225.     ))
  1226.  
  1227.     ;*** Backup documentation
  1228.     ;***
  1229.     (if (P_CheckExistsPat (tackon #destdocs #destdocsdir) "Documentation") (
  1230.  
  1231.         (copyfiles
  1232.             (source (tackon #destdocs #destdocsdir))
  1233.             (dest (tackon #destback #destbackdir))
  1234.             (pattern "Documentation")
  1235.             (nogauge)
  1236.             (infos)
  1237.         )
  1238.  
  1239.         (P_Delete (tackon (tackon #destdocs #destdocsdir) "Documentation") "icons" "req")
  1240.     ))
  1241.  
  1242.     (if (P_CheckExistsPat (tackon #destdocs #destdocsdir) "Dokumentation") (
  1243.  
  1244.         (copyfiles
  1245.             (source (tackon #destdocs #destdocsdir))
  1246.             (dest (tackon #destback #destbackdir))
  1247.             (pattern "Dokumentation")
  1248.             (nogauge)
  1249.             (infos)
  1250.         )
  1251.  
  1252.         (P_Delete (tackon (tackon #destdocs #destdocsdir) "Dokumentation") "icons" "req")
  1253.     ))
  1254.  
  1255.  
  1256.     ;*** Backup goodies
  1257.     ;***
  1258.     (if (P_CheckExistsPat (tackon #destutil #destutildir) "Goodies") (
  1259.  
  1260.         (copyfiles
  1261.             (source (tackon #destutil #destutildir))
  1262.             (dest (tackon #destback #destbackdir))
  1263.             (pattern "Goodies")
  1264.             (nogauge)
  1265.             (infos)
  1266.         )
  1267.  
  1268.         (P_Delete (tackon (tackon #destutil #destutildir) "Goodies") "icons" "req")
  1269.     ))
  1270.  
  1271. )
  1272.  
  1273.  
  1274. ;***************************************************************************************************
  1275. ;***    Procedure PreDeInstall
  1276. ;***************************************************************************************************
  1277. (procedure P_PreDeInstall
  1278.  
  1279.     ;*** Create a scriptfile header
  1280.     ;***
  1281.     (run (cat "echo >t:csinstdelete.temp \";csinstdelete.temp - Temporary file - Do not edit or delete*n\""))
  1282.  
  1283.     (set match 0)
  1284.  
  1285.     ;*** Check for files do delete
  1286.     ;***
  1287.     (if (P_CheckExistsPat #destdevs #devspat)                                                (set match (BITOR match 1)))
  1288.     (if (P_CheckExistsPat #destlibs (cat "~(" #vmcrsc "|~(" #libspat "))"))                    (set match (BITOR match 2)))
  1289.     (if (P_CheckExistsPat (tackon #destdocs #destdocsdir) "(Documentaion|Dokumentation)")    (set match (BITOR match 4)))
  1290.     (if (P_CheckExistsPat (tackon #destutil #destutildir) "Goodies")                        (set match (BITOR match 8)))
  1291.     (if (P_CheckExistsPat #destlibs #vmcrsc)                                                (set match (BITOR match 16)))
  1292.  
  1293.     ;*** Delete libs files if available AND no isdn installed (ask expert user)!
  1294.     ;***
  1295.     (if (= 3 #instchoice) (
  1296.  
  1297.         (set isdninst (P_CheckExistsPat #destdevs #devsisdnpat))
  1298.  
  1299.         (if (<> 0 isdninst) (
  1300.             (if (IN match 4) (
  1301.                 (if (> (getversion (tackon #destlibs #vmcrsc)) (getversion (tackon (tackon (pathonly @icon) "libs") #vmcrsc))) (
  1302.  
  1303.                     (set delrsclib 0)
  1304.  
  1305.                     (if (= 2 @user-level) (
  1306.  
  1307.                         (set    delrsclib
  1308.                             (askbool
  1309.                                 (prompt        #msgdelrsclib)
  1310.                                 (help        (cat #msgdelrsclib @askbool-help))
  1311.                                 (default    0)
  1312.                             )
  1313.                         )
  1314.                     ))
  1315.  
  1316.                     (if (= 1 delrsclib) (P_DeleteConfirmFiles #destlibs #vmcrsc 0))
  1317.                 ))
  1318.             ))
  1319.         ))
  1320.     ))
  1321.  
  1322.     ;*** Reset vmcresource flag
  1323.     ;***
  1324.     (set match (BITAND match 15))
  1325.  
  1326.     ;*** Found some?
  1327.     ;***
  1328.     (if (<> match 0 ) (
  1329.  
  1330.         (if (= 2 @user-level) (message #msgoldfilesexp) (message #msgoldfilesave))
  1331.  
  1332.         ;*** Delete devs files.
  1333.         ;***
  1334.         (if (IN match 0) (P_DeleteConfirmFiles #destdevs #devspat 0))
  1335.  
  1336.         ;*** Delete libs files.
  1337.         ;***
  1338.         (if (IN match 1) (P_DeleteConfirmFiles #destlibs #libspat 0))
  1339.  
  1340.         ;*** Delete dokumentation files.
  1341.         ;***
  1342.         (if (IN match 2) (P_DeleteConfirmFiles (tackon #destdocs #destdocsdir) "(Documentation|Dokumentation)" 1))
  1343.  
  1344.         ;*** Delete goodie files.
  1345.         ;***
  1346.         (if (IN match 3) (P_DeleteConfirmFiles (tackon #destutil #destutildir) "Goodies" 1))
  1347.  
  1348.         ;*** Delete docs/goodies directory.
  1349.         ;***
  1350.         (P_DeleteConfirmFiles #destdocs #destdocsdir 1)
  1351.  
  1352.         (if (OR (<> #destdocs #destutil) (<> #destdocsdir #destutildir)) (
  1353.             (P_DeleteConfirmFiles #destutil #destutildir 1)
  1354.  
  1355.         ))
  1356.     ))
  1357. )
  1358.  
  1359.  
  1360. ;***************************************************************************************************
  1361. ;***    Procedure DeleteConfirmFiles
  1362. ;***************************************************************************************************
  1363. (procedure P_DeleteConfirmFiles p_dir p_pat p_isdir
  1364.  
  1365.     ;*** Reset all used vars.
  1366.     ;***
  1367.     (set cnt 0)
  1368.     (set defopt 0)
  1369.  
  1370.     (if (P_CheckExistsPat p_dir p_pat) (
  1371.  
  1372.         (foreach p_dir p_pat (
  1373.  
  1374.             (symbolset (cat "f" cnt) (tackon p_dir @each-name))
  1375.  
  1376.             (set defopt (BITOR defopt (shiftleft 1 cnt)))
  1377.             (set cnt (+ 1 cnt))
  1378.  
  1379.             (if (= 14 cnt) (
  1380.                 (set usedopt (P_DeleteConfirmFiles2 defopt p_isdir f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13))
  1381.  
  1382.                 (set cnt 0)
  1383.                 (set defopt 0)
  1384.             ))
  1385.         ))
  1386.  
  1387.         (while (< cnt 14) (
  1388.             (symbolset (cat "f" cnt) "")
  1389.             (set cnt (+ 1 cnt))
  1390.         ))
  1391.  
  1392.         (set usedopt (P_DeleteConfirmFiles2 defopt p_isdir f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13))
  1393.     ))
  1394.  
  1395.     (set usedopt usedopt)
  1396. )
  1397.  
  1398.  
  1399. ;***************************************************************************************************
  1400. ;***    Procedure DeleteConfirmFiles2
  1401. ;***************************************************************************************************
  1402. (procedure P_DeleteConfirmFiles2 p_defopt p_isdir p_f0 p_f1 p_f2 p_f3 p_f4 p_f5 p_f6 p_f7 p_f8 p_f9 p_f10 p_f11 p_f12 p_f13
  1403.  
  1404.     (if (= 2 @user-level)
  1405.     (
  1406.         (set    choice (
  1407.             (askoptions (
  1408.                 (prompt        #msgoldfiles2)
  1409.                 (help        #msgoldfiles2 @askoptions-help)
  1410.                 (choices    p_f0 p_f1 p_f2 p_f3 p_f4 p_f5 p_f6 p_f7 p_f8 p_f9 p_f10 p_f11 p_f12 p_f13)
  1411.                 (default    p_defopt)
  1412.             ))
  1413.         ))
  1414.     )
  1415.     (set choice p_defopt))
  1416.  
  1417.     (set cnt 0)
  1418.  
  1419.     (while (< cnt 14) (
  1420.  
  1421.         (if (IN choice cnt) (
  1422.             (set delfile (select cnt p_f0 p_f1 p_f2 p_f3 p_f4 p_f5 p_f6 p_f7 p_f8 p_f9 p_f10 p_f11 p_f12 p_f13))
  1423.  
  1424.             ;*** Append a delete command for each file/dir.
  1425.             ;***
  1426.             (if (<> 0 p_isdir )
  1427.                 (run (cat "echo >>t:csinstdelete.temp \"delete " delfile " all\""))
  1428.                 (run (cat "echo >>t:csinstdelete.temp \"delete " delfile "\""))
  1429.             )
  1430.         ))
  1431.  
  1432.         (set cnt (+ 1 cnt))
  1433.     ))
  1434.  
  1435.     (set choice choice)
  1436. )
  1437.  
  1438.  
  1439. ;***************************************************************************************************
  1440. ;***    Procedure DeInstall
  1441. ;***************************************************************************************************
  1442. (procedure P_DeInstall
  1443.  
  1444.     ;*** Now REALLY delete the old files (script made by SetupInstall/PreDeInstall).
  1445.     ;***
  1446.     (if (<> 1 @pretend) (
  1447.         (execute "t:csinstdelete.temp")
  1448.     ))
  1449.  
  1450.     (P_Delete (tackon #destdevs "hyperIOVersion") "noicons" "noreq")
  1451. )
  1452.  
  1453.  
  1454. ;***************************************************************************************************
  1455. ;***    Procedure AfterInstall
  1456. ;***************************************************************************************************
  1457. (procedure P_AfterInstall
  1458.  
  1459.     (if (<> 3 #instchoice) (
  1460.         (if (<> 0 (P_CheckExists "sys:utilities/multiview"))
  1461.             (set mvpath "sys:utilities/multiview ")
  1462.  
  1463.             (if (<> 0 (P_CheckExists "sys:system/multiview"))
  1464.                 (set mvpath "sys:utilities/multiview ")
  1465.                 (set mvpath "multiview ")
  1466.             )
  1467.         )
  1468.  
  1469.         (if (= 1 (askbool
  1470.             (prompt #msgshowreadme)
  1471.             (default 1)
  1472.             (help (cat #msgshowreadme "\n\n" @askbool-help))))
  1473.  
  1474.             (if (= @language "deutsch")
  1475.                 (run (cat mvpath "LiesMichZuerst.guide"))
  1476.                 (run (cat mvpath "ReadMeFirst.guide"))
  1477.             )
  1478.         )
  1479.  
  1480.         (user 2)
  1481.         (if (= 1 (askbool
  1482.             (prompt #msgreboot)
  1483.             (help (cat #msgreboot "\n\n" @askbool-help))
  1484.             (default 1)
  1485.             (choices #msgrebootyes #msgrebootno)))
  1486.             (run (tackon (pathonly @icon) "reboot"))
  1487.         )
  1488.     ))
  1489. )
  1490.  
  1491.  
  1492. ;***************************************************************************************************
  1493. ;***    Procedure Cleanup
  1494. ;***************************************************************************************************
  1495. (procedure P_Cleanup
  1496.  
  1497.     (delete "t:csinstcheckpat#?.temp")
  1498.     (delete "t:csinstdelete.temp")
  1499. )
  1500.  
  1501.  
  1502. ;***************************************************************************************************
  1503. ;***    Entry point
  1504. ;***************************************************************************************************
  1505. ;*** No user should have a Installer version below 43.3!
  1506.  
  1507. (if (< @installer-version 2818051) (
  1508.     (message #wronginstaller)
  1509.     (exit (quiet))
  1510. ))
  1511.  
  1512. (complete 0)
  1513.  
  1514. (P_PreInstall)
  1515.  
  1516. (welcome)
  1517.  
  1518. (P_About)
  1519.  
  1520. (if (P_CheckOldInst) (
  1521.  
  1522.     (complete 5)
  1523.  
  1524.     (P_CheckOS)
  1525.     (P_CheckCPU)
  1526.  
  1527.     (P_PrepareInstall)
  1528.  
  1529.     (complete 10)
  1530.  
  1531.     ;*** Ask for confirmation
  1532.     (if (P_AskConfirmation) (
  1533.  
  1534.         (complete 20)
  1535.         (P_SetupInstall)
  1536.  
  1537.         (complete 40)
  1538.         (P_DoInstall)
  1539.  
  1540.         (complete 100)
  1541.         (P_AfterInstall)
  1542.     ))
  1543.  
  1544.     (P_Cleanup)
  1545.  
  1546.     (if (<> 3 #instchoice) (exit #msgendinst (quiet)) (exit #msgenddeinst (quiet)))
  1547. ))
  1548.  
  1549. (complete 100)
  1550. (P_Cleanup)
  1551. (exit #msgend2 (quiet))
  1552.  
  1553.  
  1554.