home *** CD-ROM | disk | FTP | other *** search
Wrap
; $VER: Installation script for DRemind 1.0 (16.09.2000) ; © Alexander Döller ; Created with GoldED 6.17 ; Minor modifications made by Daniel Westerberg ; check if we are running under correct OS (set @default-dest "ram:") (COMPLETE 0) (if (< (/ (getversion) 65536) 37) ( (abort "Incorrect OS version (software requires OS 37 or better )!") ) ) ; error handling (onerror (if (> @ioerr 0) ( (message ("An error has occurred during installation. Please check the log file to understand the error.") ) ) ) (exit (quiet)) ) (set #installmode (askbool (prompt "\nChoose the installation mode:") (help @askbool-help) (choices "Install" "Uninstall" ) (default 1) ) ) (if (= #installmode 1) ; normal installation ( (welcome) ; --- insert your code below --- (set @CDty-dest (askdir (prompt "Please choose the installation path for the DRemind-Commodity:\n('SYS:WBStartup' is recommend if you want to start DRemind at startup time.)") (help "If you specify 'SYS:WBStartup' the system will start DRemind at startup for you.\nIf you choose to install it to an other dir you will have to start it manually.") (default "SYS:WBStartup/") ) ) (COMPLETE 10) (set @Prefs-dest (askdir (prompt "Please choose the installation path for the DRemind-Preferences program:\n('SYS:Prefs' is recommend if you want DRemind to be able to start the preferences program.)") (help "If you choose to install it to an other dir you will have to call DRemindPrefs yourself every time you want to change the prefs.") (default "SYS:Prefs/") ) ) (COMPLETE 20) (copyfiles (source "DRemind/DRemind") (dest @CDty-dest) (infos) (optional "oknodelete" "force" "askuser") ) (COMPLETE 30) (copyfiles (source "DRemind/DRemindPrefs") (dest @Prefs-dest) (infos) (optional "oknodelete" "force" "askuser") ) (COMPLETE 40) (set image_dir (askdir (prompt "Please choose the directory for the configuration file: ('ENVARC' = default)\nNote: If you set any other destination than ENVARC: don't forget to change the dir in DRemindPrefs as well!") (help @askdir-help) (default "ENVARC:") ) ) (COMPLETE 50) ; uncomment if you want to show a picture of the available images ; (run "run sys:utilities/multiview DRemind/DRemind.image" (safe)) (set #result (askchoice (prompt "Which image to install?") (help @askchoice-help) (choices "1. - Amiga Boing" "2. - New Hand in B/W" "3. - New Hand in Red" "4. - The Hand (default)" ) (default 3) ) ) (if (= #result 0) (set image_source "DRemind/Images/Boing/") ) (if (= #result 1) (set image_source "DRemind/Images/NewHand_BW/") ) (if (= #result 2) (set image_source "DRemind/Images/NewHand_Red/") ) (if (= #result 3) (set image_source "DRemind/Images/TheHand/") ) (working "Copying image for DRemind ...") (copyfiles (source (tackon image_source "DRemind.image")) (dest image_dir) (optional "nofail") ) (COMPLETE 60) (set #result (askchoice (prompt "Which icons to install?") (help @askchoice-help) (choices "1. - Standard 4-colour" "2. - MagicWB" "3. - OS3.5 GlowIcons" ) (default 2) ) ) (if (= #result 0) (set image_source "DRemind/Icons/Old/") ) (if (= #result 1) (set image_source "DRemind/Icons/MagicWB") ) (if (= #result 2) (set image_source "DRemind/Icons/OS3.5/") ) (working "Copying icons for DRemind ...") (copyfiles (source (tackon image_source "DRemind.info")) (dest @CDty-dest) (optional "nofail") ) (copyfiles (source (tackon image_source "DRemindPrefs.info")) (dest @Prefs-dest) (optional "nofail") ) (COMPLETE 70) (if (= @language "english") (set #def_lang 0) ) (if (= @language "deutsch") (set #def_lang 1) ) (if (= @language "español") (set #def_lang 2) ) (if (= @language "français") (set #def_lang 3) ) (if (= @language "magyar") (set #def_lang 4) ) (if (= @language "polski") (set #def_lang 5) ) (set #result (askchoice (prompt "\nPlease select the language to install:\n") (help @askchoice-help) (choices "english" "deutsch" "español" "français" "magyar" "polski" ) (default #def_lang) ) ) (if (= #result 0) (set language "english") ) (if (= #result 1) (set language "deutsch") ) (if (= #result 2) (set language "español") ) (if (= #result 3) (set language "français") ) (if (= #result 4) (set language "magyar") ) (if (= #result 5) (set language "polski") ) (copyfiles (source (tackon "DRemind/Catalogs" language)) (dest (tackon "LOCALE:Catalogs" language)) (pattern "#?") (optional "nofail" "force" "askuser") ) (COMPLETE 80) (set #result (askoptions (prompt "What to install else?") (help @askoptions-help) (choices "Documentation" "Other images for DRemind" "Translation (for developers)" "Readme files" ) (default (+ 1 2 4 8)) ) ) (if (= #result 0) (exit) ) (set dest_dir (askdir (prompt "Please choose the directory for the DRemind stuff:\n(A new dir will be created.)") (help @askdir-help) (default "SYS:Utilities/") (newpath) ) ) (set @default-dest dest_dir) (COMPLETE 90) (set dest_dir (tackon dest_dir "DRemind")) (if (in #result 0) (copyfiles (source "DRemind/DRemind.Guide") (dest dest_dir) (infos) (optional "oknodelete" "force" "askuser") ) ) (if (in #result 1) (copyfiles (source "DRemind/Images/") (dest (tackon dest_dir "Images")) (infos) (pattern "#?") (optional "oknodelete" "force" "askuser") ) ) (if (in #result 2) (copyfiles (source "DRemind/Translations/") (dest (tackon dest_dir "Translations")) (infos) (files) (pattern "#?") (optional "oknodelete" "force" "askuser") ) ) (if (in #result 3) (copyfiles (source "DRemind/") (dest dest_dir) (infos) (pattern "#?.Readme") (optional "oknodelete" "force" "askuser") ) ) (COMPLETE 100) ; --- end of your code --- (exit) ) ; uninstall application ( ; --- insert your code below --- (message "DRemind can only be removed from the system if was installed with the default settings for the dirs!") (delete "SYS:WBStartup/DRemind") (delete "SYS:WBStartup/DRemind.info") (COMPLETE 20) (delete "SYS:Prefs/DRemindPrefs") (delete "SYS:Prefs/DRemindPrefs.info") (COMPLETE 40) ; remove all available language files (delete (cat "LOCALE:Catalogs/english/DRemind.catalog")) (delete (cat "LOCALE:Catalogs/english/DRemindPrefs.catalog")) (delete (cat "LOCALE:Catalogs/deutsch/DRemind.catalog")) (delete (cat "LOCALE:Catalogs/deutsch/DRemindPrefs.catalog")) (delete (cat "LOCALE:Catalogs/español/DRemind.catalog")) (delete (cat "LOCALE:Catalogs/español/DRemindPrefs.catalog")) (delete (cat "LOCALE:Catalogs/français/DRemind.catalog")) (delete (cat "LOCALE:Catalogs/français/DRemindPrefs.catalog")) (delete (cat "LOCALE:Catalogs/magyar/DRemind.catalog")) (delete (cat "LOCALE:Catalogs/magyar/DRemindPrefs.catalog")) (delete (cat "LOCALE:Catalogs/polski/DRemind.catalog")) (delete (cat "LOCALE:Catalogs/polski/DRemindPrefs.catalog")) (COMPLETE 60) (delete "ENVARC:DRemind.image") (delete "ENVARC:DRemind.prefs") (delete "ENVARC:DRemind.temp") (delete "ENVARC:DRemind.temps") ; remove MUI-settings as well (delete "ENVARC:mui/DREMIND.prefs") (delete "ENVARC:mui/DRPREFS.1.prefs") (set #result (askbool (prompt "Did you install the additional files?") (help @askbool-help) (choices "Yes" "No" ) (default 1) ) ) (COMPLETE 80) (if (= #result 1) ( (set dest_dir (askdir (prompt "Please choose the directory where you installed the DRemind stuff:") (help @askdir-help) (default "SYS:Utilities") (newpath) ) ) (run (cat "C:delete >NIL: " dest_dir "/DRemind ALL QUIET FORCE")) (delete (cat dest_dir "/DRemind.info")) ) ) (COMPLETE 100) ; -- end of your code --- (message "Uninstallation completed.") (exit (quiet)) ) )