
;***********
;*         *
;* STRINGS *
;*         *
;***********

(set #LANG_FOUND 0)

(if (= "deutsch" @language)
       (
	(set #MSG_WELCOME "Willkommen beim Installations-Skript für \"CopyIcon\".")
	(set #MSG_WELCOME_WARN "\n\nSie benutzen eine alte Version (<42) des Installers. Das könnte unter Umständen Probleme bereiten!")

	(set #MSG_SELECTEXEPATH "In welches Verzeichnis soll das Programm  (\"CopyIcon\") kopiert werden?")
	(set #MSG_SELECTDOCPATH "In welches Verzeichnis soll die Dokumentation (\"CopyIcon.guide\") kopiert werden?")

	(set #MSG_COPY_EXE "Kopiere CopyIcon")
	(set #MSG_COPY_DOC "Kopiere Dokumentation")

	(set #MSG_ICONPOS "Korrigiere Icon Position")

	(set #MSG_NOHELP "Keine Hilfe verfügbar. Sorry. Ich bin einfach zu faul :-( Lesen Sie das \"CopyIcon.guide\"!")

	(set #LANG_FOUND 1)
       )
)

(if (= "italiano" @language)
       (
	(set #MSG_WELCOME "Benvenuto nello script di installazione per \"CopyIcon\".")
	(set #MSG_WELCOME_WARN "\n\nLei possiede una versione vecchia (<42) dell'Installer. Questo potrebbe eventualmente causare dei problemi!")

	(set #MSG_SELECTEXEPATH "In che directory devo copiare il programma (\"CopyIcon\")?")
	(set #MSG_SELECTDOCPATH "In che directory devo copiare la documentazione (\"CopyIcon.guide\")?")

	(set #MSG_COPY_EXE "Copio CopyIcon")
	(set #MSG_COPY_DOC "Copio documentazione")
	
	(set #MSG_ICONPOS "Corrego posizione dell'icona")

	(set #MSG_NOHELP "Nessun aiuto disponibile. Sorry. Sono troppo pigro :-( Leggi il \"CopyIcon.guide\"!")

        (set #LANG_FOUND 1)
       )
)

(if (= 0 #LANG_FOUND)
       (
	(set #MSG_WELCOME "Welcome to the installation script for \"CopyIcon\".")
	(set #MSG_WELCOME_WARN "\n\nYou are using an old version (<42) of the Installer. This might eventually cause problems!!")

	(set #MSG_SELECTEXEPATH "Where do you want the executable (\"CopyIcon\") to be copied?")
	(set #MSG_SELECTDOCPATH "Where do you want the documentation (\"CopyIcon.guide\") to be copied?")

	(set #MSG_COPY_EXE "Copying CopyIcon")
	(set #MSG_COPY_DOC "Copying documentation")
	
	(set #MSG_ICONPOS "Correcting icon position")

	(set #MSG_NOHELP "No help available. Sorry. I'm just too lazy :-( Have a look at \"CopyIcon.guide\"!")

       )
)

;==========================================================================

;********
;*      *
;* MAIN *
;*      *
;********

(set #OSVERSION (/ (getversion) 65536))

(if (< (/ @installer-version 65536) 42)
	(welcome #MSG_WELCOME #MSG_WELCOME_WARN)
	(welcome "\n" #MSG_WELCOME)
)

;******************
;*                *
;* SELECT EXE DIR *
;*                *
;******************

(set #exedest
	(Expandpath
		(askdir (prompt #MSG_SELECTEXEPATH)
			(default "SYS:Utilities")
			(help #MSG_NOHELP)
		)
	)
)

;******************
;*                *
;* SELECT DOC DIR *
;*                *
;******************

(set #docdest
	(Expandpath
		(askdir (prompt #MSG_SELECTDOCPATH)
			(default "HELP:")
			(help #MSG_NOHELP)
		)
	)
)

;**************
;*            *
;* COPY FILES *
;*            *
;**************

(copyfiles (prompt #MSG_COPY_EXE)
	   (source "")
	   (choices "CopyIcon" "CopyIcon.info")
	   (dest #exedest)
	   (confirm)
	   (help #MSG_NOHELP)
)

(copyfiles (prompt #MSG_COPY_DOC)
	   (source "")
	   (choices "CopyIcon.guide" "CopyIcon.guide.info")
	   (dest #docdest)
	   (confirm)
	   (infos)
	   (help #MSG_NOHELP)
)

(if (exists (tackon #exedest "CopyIcon.info"))
	(run	("c/noiconpos %s" (tackon #exedest "CopyIcon"))
		(prompt #MSG_ICONPOS)
		(help #MSG_NOHELP)
		(confirm)
	)
)

(if (exists (tackon #docdest "CopyIcon.guide.info"))
	(run	("c/noiconpos %s" (tackon #docdest "CopyIcon.guide"))
		(prompt #MSG_ICONPOS)
		(help #MSG_NOHELP)
		(confirm)
	)
)

;***********
;*         *
;* THE END *
;*         *
;***********


(set @default-dest #exedest)

