home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 44
/
Amiga_Dream_44.iso
/
Amiga
/
applications
/
bureautique
/
TurboCalc405.lha
/
Update
/
UpdateTurboCalc
< prev
Wrap
Text File
|
1997-08-01
|
16KB
|
458 lines
; ---------------------------------------------------------------------
;
; $VER: Update Installer Script 1.05 (28.07.97)
;
; Script to update TurboCalc (German, English, Italian, French version)
;
; ⌐ 1996-97 by Michael Friedrich
;
; ---------------------------------------------------------------------
(set APPNAME "TurboCalc")
(set OLDVERSION "4.00")
(set NEWVERSION "4.05")
(if (<> @app-name "Test App")
(set APPNAME @app-name)
(set @app-name APPNAME)
)
(set #DiskVersion 0)
(set #updateprg "TurboCalcCD:Tools/Update")
(set #updateprg_disk "TurboCalc4_Disk1:Tools/Update")
(if (<> @language "english")
((if ( AND (<> @language "deutsch")
(AND (<> @language "franτais") (<> @language "italiano"))
)
(set @language "english")
)
)
)
; ---------------------------------------------------------------------
;
; STRINGS (German)
;
; ---------------------------------------------------------------------
(if (= @language "deutsch")
(
(set #SourceDir "TurboCalcCD:Deutsch/TurboCalc")
(set #SourceDir_Disk "TurboCalc4_Disk1:TurboCalc")
(set #UpdateDir "Deutsch")
(set #HelpDir "Hilfe")
(set #HelpDirOS2 "Hilfe_OS2")
(set #welcome
(cat "Dieses Skript aktualisiert das Programm " APPNAME
" von der Version " OLDVERSION " auf die Version " NEWVERSION ".\n\n"
))
(set #hello
(cat "Dieses Skript aktualisiert das Programm " APPNAME
" von der Version " OLDVERSION " auf die Version " NEWVERSION ".\n\n"
"Es wird dabei die installierte Version auf der Festplatte geΣndert; "
"die Originaldateien werden von CD/Diskette gelesen, "
"um sicherzustellen, da▀ es sich um Dateien der Version " OLDVERSION " handelt." )
)
(set #AskDestFile
(cat "Bitte bestimmen Sie den Pfad (und ggf. den Dateinamen) Ihrer alten "
APPNAME "-Version.\n" )
)
(set #AskDestFileHelp
(cat "Wechseln Sie in das Verzeichnis, in dem Sie " APPNAME " installiert haben.\n"
"Der Dateiname mu▀ normalerweise nicht verΣndert werden.\n" )
)
(set #updating (cat "Aktualisiere %s ...\n\n"
"Dies kann einige Zeit dauern,\n"
"haben Sie bitte etwas Geduld.\n" ))
(set #ErrorUpdateMissing (cat "Das Programm zum Aktualisieren der "
"Dateien (%s) ist leider nicht vorhanden. Legen Sie bitte die "
"Original TurboCalc4-CD (TurboCalcCD:) oder Diskette 1 "
"(TurboCalc4_Disk1:) ein und klicken Sie auf 'Weiter'!" ))
(set #ErrorPrgFileMissing (cat "Der Pfad, in dem " APPNAME " aktualisiert "
"werden soll, scheint nicht korrekt zu sein (%s). "
"Das Hauptprogramm '%s' konnte an dieser Stelle nicht gefunden werden. "
"Bitte suchen Sie im folgenden Dateirequester " APPNAME " und "
"wΣhlen Sie diese Datei aus." ))
(set #ErrorMsg (cat "Beim Aktualisieren trat folgender Fehler auf:\n%s\n"
"Die Datei wurde nicht modifiziert!\n "))
(set #Err1 "Kann Alte-Datei nicht ÷ffnen." )
(set #Err2 "Kann Dif-Datei nicht ÷ffnen." )
(set #Err3 "Kann Neue-Datei nicht ÷ffnen." )
(set #Err4 "Falsche Alte-Datei (falsche LΣnge), UPDATE nicht m÷glich!" )
(set #Err5 "Falsche Alte-Datei (CRC falsch), UPDATE nicht m÷glich!" )
(set #Err6 "Falsche Alte-Datei (VER falsch), UPDATE nicht m÷glich!" )
(set #Err7 "Falsche Dif-Datei-Version, UPDATE mit dieser Version nicht m÷glich!" )
(set #Err8 "Nicht genⁿgend Speicher!" )
(set #Err9 "Unbekannter Fehler: 9" )
(set #Err10 "Konnte das Programm UPDATE nicht finden!\n")
(set #ErrUnkown "Unbekannter Fehler: %s" )
)
)
; ---------------------------------------------------------------------
;
; STRINGS (English)
;
; ---------------------------------------------------------------------
(if (= @language "english")
(
(set #SourceDir "TurboCalcCD:English/TurboCalc")
(set #SourceDir_Disk "TurboCalc4_Disk1:TurboCalc")
(set #UpdateDir "English")
(set #HelpDir "Help")
(set #HelpDirOS2 "Help_OS2")
(set #welcome
(cat "This scripts updates the program " APPNAME
" from version " OLDVERSION " to the new version " NEWVERSION ".\n\n"
))
(set #hello
(cat "This scripts updates the program " APPNAME
" from version " OLDVERSION " to the new version " NEWVERSION ".\n\n"
"It modifies the installed version on your hard disk; "
"the old files are read from the original CD/Diskette to assure "
"that these files are really from version " OLDVERSION "." )
)
(set #AskDestFile
(cat "Please select the path (including " APPNAME "'s name) where you have "
"installed your old " APPNAME " version.\n" )
)
(set #AskDestFileHelp
(cat "Change to the drawer where you have installed " APPNAME ".\n"
"The filename is normally correct and thus needn't changed.\n" )
)
(set #updating (cat "Updating %s ...\n\n"
"Please be patient.\n" ))
(set #ErrorUpdateMissing (cat "The program that updates the "
"files (%s) is not available. Please insert the "
"original TurboCalc4 CDROM (TurboCalcCD:) or diskette #1 "
"(TurboCalc4_Disk1:) and try again!" ))
(set #ErrorPrgFileMissing (cat APPNAME "'s path is not correct (%s). "
"The program '%s' couldn't be found there. "
"Please choose the correct path/file for " APPNAME " in the "
"following filerequester." ))
(set #ErrorMsg (cat "An error occured during updating:\n%s\n"
"The file wasn't modified.\n"))
(set #Err1 "Couldn't open Old-File." )
(set #Err2 "Couldn't open Dif-File." )
(set #Err3 "Coudln't open New-File." )
(set #Err4 "Wrong Old-File (wrong size), UPDATE impossible!" )
(set #Err5 "Wrong Old-File (CRC incorrect), UPDATE impossible!" )
(set #Err6 "Wrong Old-File (wrong VER), UPDATE impossible!" )
(set #Err7 "Wrong Dif-File-Version, UPDATE with this version of UPDATE not possible!" )
(set #Err8 "Not enough memory!" )
(set #Err9 "Unknown error: 9" )
(set #Err10 "UPDATE not found!\n")
(set #ErrUnkown "Unknown error: %s" )
)
)
; ---------------------------------------------------------------------
;
; STRINGS (Italian)
;
; ---------------------------------------------------------------------
(if (= @language "italiano")
(
(set #SourceDir "TurboCalcCD:Italiano/TurboCalc")
(set #SourceDir_Disk "TurboCalc4_Disk1:TurboCalc")
(set #UpdateDir "Italiano")
(set #HelpDir "Aiuto")
(set #HelpDirOS2 "Aiuto_OS2")
(set #welcome
(cat "Questo script aggiorna il programma " APPNAME
" dalla versione " OLDVERSION " alla nuova versione " NEWVERSION ".\n\n"
))
(set #hello
(cat "Questo script aggiorna il programma " APPNAME
" dalla versione " OLDVERSION " alla nuova versione " NEWVERSION ".\n\n"
"Esso modifica la versione installata sul proprio disco rigido; "
"i vecchi file sono letti dal CD/Dischetto originale per essere "
"sicuri che essi appartengano davvero alla versione " OLDVERSION "." )
)
(set #AskDestFile
(cat "Indicare il percorso (includendo il nome di " APPNAME ") in cui fu "
"installata la vecchia versione di " APPNAME ".\n" )
)
(set #AskDestFileHelp
(cat "Scelta del cassetto in cui fu installato " APPNAME ".\n"
"Il nome del programma Φ in genere corretto e non deve essere cambiato.\n" )
)
(set #updating (cat "Aggiornamento di %s ...\n\n"
"Attendere prego.\n" ))
(set #ErrorUpdateMissing (cat "Programma per l'aggiornamento dei "
"file (%s) non disponibile. Inserire il CD-ROM"
"originale di TurboCalc4 (TurboCalcCD:) o il dischetto #1 "
"(TurboCalc4_Disk1:) e riprovare!" ))
(set #ErrorPrgFileMissing (cat "Percorso di " APPNAME " errato (%s). "
"Il programma '%s' non Φ presente. "
"Scegliere il percorso/file corretto per " APPNAME " nella "
"seguente finestra per scelta file." ))
(set #ErrorMsg (cat "Errore occorso durante l'aggiornamento:\n%s\n"
"Il file non Φ stato modificato.\n"))
(set #Err1 "Impossibile aprire il file vecchio." )
(set #Err2 "Impossibile aprire il file dif." )
(set #Err3 "Impossibile aprire il file nuovo." )
(set #Err4 "File vecchio errato (dimensione errata), AGGIORNAMENTO impossibile!" )
(set #Err5 "File vecchio errato (CRC errato), AGGIORNAMENTO impossibile!" )
(set #Err6 "File vecchio errato (VER errata), AGGIORNAMENTO impossibile!" )
(set #Err7 "Errata versione file dif, AGGIORNAMENTO impossibile con questa versione!" )
(set #Err8 "Memoria insufficiente!" )
(set #Err9 "Errore sconosciuto: 9" )
(set #Err10 "AGGIORNAMENTO non trovato!\n")
(set #ErrUnkown "Errore sconosciuto: %s" )
)
)
; ---------------------------------------------------------------------
;
; STRINGS (French)
;
; ---------------------------------------------------------------------
(if (= @language "franτais")
(
(set #SourceDir "TurboCalcCD:Franτais/TurboCalc")
(set #SourceDir_Disk "TurboCalc4_Disk1:TurboCalc")
(set #UpdateDir "Franτais")
(set #HelpDir "Aide")
(set #HelpDirOS2 "Aide_OS2")
(set #welcome
(cat "Ce script met α jour le programme " APPNAME
" de la version " OLDVERSION " α la nouvelle version " NEWVERSION ".\n\n"
))
(set #hello
(cat "Ce script met α jour le programme " APPNAME
" de la version " OLDVERSION " α la nouvelle version " NEWVERSION ".\n\n"
"Il modifie la version installΘe sur votre disque dur. "
"Les anciens fichiers sont lus depuis le CD ou les disquettes originales "
"afin de s'assurer qu'ils proviennent bien de la version " OLDVERSION ".\n"
; Note: the following two lines will only be shown in French!
"Note : Macros.guide est Θgalement mis α jour s'il est trouvΘ dans le "
"sous-rΘpertoire ½ Aide ╗." )
)
(set #AskDestFile
(cat "Veuillez sΘlectionner le chemin (y compris le nom " APPNAME ") o∙ vous "
"avez installΘ l'ancienne version de " APPNAME ".\n" )
)
(set #AskDestFileHelp
(cat "Change de rΘpertoire jusqu'α celui o∙ vous avez installΘ " APPNAME ".\n"
"Le nom de fichier est thΘoriquement Ωtre correct et ne devrait donc pas Ωtre changΘ.\n" )
)
(set #updating (cat "Mise α jour de %s ...\n\n"
"Veuillez patienter.\n" ))
(set #ErrorUpdateMissing (cat "Le programme qui met α jour les "
"fichiers (%s) n'est pas disponible. Veuillez insΘrer le CDROM "
"original de TurboCalc 4 (TurboCalcCD:) ou la disquette #1 "
"(TurboCalc4_Disk1:) et rΘessayez !" ))
(set #ErrorPrgFileMissing (cat "Le chemin de " APPNAME " est incorrect (%s). "
"Le programme '%s' n'a pas pu y Ωtre trouvΘ. "
"Veuillez choisir le chemin ou le fichier correct pour " APPNAME " dans "
"le selecteur de fichiers qui suit." ))
(set #ErrorMsg (cat "Une erreur est survenue pendant la mise α jour de :\n%s\n"
"Le fichier n'est pas modifiΘ.\n"))
(set #Err1 "Impossible d'ouvrir l'ancien fichier." )
(set #Err2 "Impossible d'ouvrir le fichier de diffΘrences." )
(set #Err3 "Impossible d'ouvrir le nouveau fichier." )
(set #Err4 "Ancien fichier erronΘ (taille incorrecte), mise α jour impossible !" )
(set #Err5 "Ancien fichier erronΘ (somme de contr⌠le incorrecte), mise α jour impossible !" )
(set #Err6 "Ancien fichier erronΘ (version incorrecte), mise α jour impossible !" )
(set #Err7 "Version de fichier de diffΘrences erronΘe, mise α jour impossible vers cette version !" )
(set #Err8 "MΘmoire insuffisante !" )
(set #Err9 "Erreur inconnue : 9" )
(set #Err10 "Mise α jour non trouvΘe !\n")
(set #ErrUnkown "Erreur inconnue : %s" )
)
)
;------------------------------------------------------------------------
(procedure P_UPDATE #up_dpath #up_spath #up_upath #up_file #up_msg
(if (exists (tackon #up_dpath #up_file) (noreq))
(
(set #up_msg #up_file)
(working (#updating #up_msg))
; run the update utility
(set res (run (cat #updateprg " \"" (tackon #up_spath #up_file) "\" \"" (tackon #up_upath #up_file) ".dif\" \"" (tackon #up_dpath #up_file) "\"")))
; has an error occured?
(if (= res 0)
(set res 0)
(message (#ErrorMsg
(if (<= res 8)
(select res #Err1 #Err2 #Err3 #Err4 #Err5 #Err6 #Err7 #Err8)
( if (= res 10) (#Err10)
(#ErrUnkown res)
)
))
) ; message
) ; if
)
) ; if exists
) ; UPDATE
;------------------------------------------------------------------------
; Where is APPNAME installed? Perhaps we should have added an
; assign to user-startup when installing APPNAME - but why add
; an assign if we only need it for this purpose.
; So we simply look at some default locations - and ask the user
; otherwise
; APPNAME (including path if found) is returned in PrgFile, then
(procedure P_FINDAPP
(set PrgFile APPNAME)
(set #n 0)
(while (set #thisfile (select #n "TurboCalc:" "Work:TurboCalc" "SYS:Work/TurboCalc" "SYS:TurboCalc" "dh0:Work/TurboCalc" "dh0:TurboCalc" "dh1:Work/TurboCalc" "dh1:TurboCalc" ""))
(
(set #n (+ #n 1))
(if (= PrgFile APPNAME) ; i.e. not yet found
(if (= 1 (exists (tackon #thisfile APPNAME) (noreq)))
(set PrgFile (tackon #thisfile APPNAME))
) ; if
) ; if
)
) ; while
)
; ---------------------------------------------------------------------
;
; INSTALLATION SCRIPT - BEGIN
;
; ---------------------------------------------------------------------
; *** say hello to the user
(welcome #welcome)
(message #hello)
; *** check that 'Update' is available (either CD or Disk 1)
(while (AND
(<> 1 (exists #updateprg (noreq)))
(<> 1 (exists #updateprg_disk (noreq)))
)
(
(if (= 0 @user-level) (user 1))
(message (#ErrorUpdateMissing #updateprg))
)
)
(if (= 1 (exists #updateprg_disk (noreq)))
(
(set #DiskVersion 1)
(set #updateprg #updateprg_disk)
(set #SourceDir #SourceDir_Disk)
)
)
(complete 5)
; *** ask user where he has installed the old version of the app.
(P_FINDAPP)
(set PrgFile
(askfile
(prompt #AskDestFile )
(help #AskDestFileHelp )
(default PrgFile)
)
)
; *** check that Prgfile really exists, else ask again
(while (<> 1 (exists PrgFile))
(
(if (= 0 @user-level) (user 1))
(message (#ErrorPrgFileMissing (pathonly PrgFile) PrgFile))
(set PrgFile
(askfile
(prompt #AskDestFile)
(help #AskDestFileHelp)
(default PrgFile)
)
)
)
)
; ***
(set @default-dest (pathonly PrgFile))
(set #defaultdata (pathonly @icon))
(set @execute-dir #defaultdata)
; *** ok, now start updating...
; update TurboCalc
(complete 10)
(P_UPDATE @default-dest #SourceDir #defaultdata "TurboCalc")
; update Macros.guide (French version only)
(complete 50)
(if (= @language "franτais")
(if (exists (tackon (tackon @default-dest #HelpDir) "Macros.guide") (noreq))
(
(set #filesize (getsize (tackon (tackon @default-dest #HelpDir) "Macros.guide")))
(if (= 265229 #filesize)
(P_UPDATE (tackon @default-dest #HelpDir)
(if #DiskVersion
(tackon @default-dest #HelpDir)
(tackon #SourceDir #HelpDirOS2)
)
(tackon #defaultdata #HelpDirOS2)
"Macros.guide" )
) ;if filesize
(if (= 272845 #filesize)
(P_UPDATE (tackon @default-dest #HelpDir)
(if #DiskVersion
(tackon @default-dest #HelpDir)
(tackon #SourceDir #HelpDirO)
)
(tackon #defaultdata #HelpDir)
"Macros.guide" )
) ;if filesize
)
) ; if exists
) ; if (language)
; *** update common files (e.g. Catalogs)
(set #defaultdata (tackon #defaultdata "/Common"))
(set @execute-dir #defaultdata)
(complete 70)
;(P_UPDATE @default-dest #SourceDir #defaultdata "Catalogs/deutsch/TurboCalc.catalog")
; *** copy any additional files
; currently not needed
; *** fine, all done
(complete 100)
; ---------------------------------------------------------------------
;
; INSTALLATION SCRIPT - END
;
; ---------------------------------------------------------------------