;NSIS MUI v.1.67 ;ÄSKULAB21 SERVER SETUP ;begonnen : Deniz Turhan/ 29.12.2003 ;-------------------------------- ;MODERN UI AKTIVIEREN !include "MUI.nsh" ;-------------------------------- ;KONFIGURATION ShowInstDetails show ; DEFINIERT DAS ICON FÜR DIE SETUP-DATEI Icon "${NSISDIR}\Contrib\Graphics\Icons\nsis1-install.ico" ; DEFINIERT DIE "CAPTION" DES INSTALLERS Caption "ÄSKULAB21 SERVER SETUP" ; EINSTELLUNG DES FARBVERLAUFS OBEN UNTEN SCHRIFT BGGradient 3399FF 000099 FFFFFF ; DEAKTIVIERT DIE BRANDMARKE AM UNTEREN RAND DES INSTALLATIONSFENSTERS BrandingText " " ; AKTIVIERT AUF XP RECHNERN DEN XP-STYLE XPStyle on ; NAME DES INSTALLERS Name "ÄSKULAB21 SERVER" ; Name der Setupdatei - Standard ist Setup.Exe, änderungen sind aber möglich OutFile "Ä21_SERVER.EXE" ; Standard Installationsverzeichnis InstallDir $PROGRAMFILES\TEST\Ä21 ; Registry key um den Installationspfad zu prüfen (Wenn man das Program erneut installiert, ; überschreibt es automatisch die alte Installation) InstallDirRegKey HKLM "Software\AESKULAB21" "Install_Dir" ;-------------------------------- ;UserVars !define type1 "ORACLE" !define type2 "SQL/MSDE" var TYPE var SERVDIR ;-------------------------------- ;MUI EINSTELLUNGEN !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\nsis1-install.ico" !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\nsis1-uninstall.ico" !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_BITMAP "C:\NSIS PROJEKT\header.bmp" !define MUI_WELCOMEFINISHPAGE_BITMAP "C:\NSIS PROJEKT\unisoft-links.bmp" !define MUI_UNWELCOMEFINISHPAGE_BITMAP "C:\NSIS PROJEKT\unisoft-links.bmp" !define MUI_ABORTWARNING !define MUI_UNABORTWARNING ;-------------------------------- ;INSTALLATIONS DIALOGE !insertmacro MUI_PAGE_WELCOME Page custom cp_type_enter !insertmacro MUI_PAGE_DIRECTORY Page custom cp_info_enter !insertmacro MUI_PAGE_INSTFILES ;-------------------------------- ;DEINSTALLATIONS DIALOGE !insertmacro MUI_UNPAGE_WELCOME !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "German" ;-------------------------------- ;Installer Functions Function .onInit SetOutPath $INSTDIR CopyFiles "$EXEDIR\aeskulab21.ini" "$INSTDIR" 0 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioSType.ini" !insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioSInfo.ini" FunctionEnd Function cp_type_enter !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSType.ini" "Field 1" "Text" "${type1}" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSType.ini" "Field 2" "Text" "${type2}" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSType.ini" "Field 3" "Text" "$_CLICK" !insertmacro MUI_HEADER_TEXT "Setup Typ" "Bitte wählen Sie den verwendeten Datenbanktyp aus" !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioSType.ini" FunctionEnd Function cp_info_enter ;DB = ORACLE StrCpy "$TYPE" "${type1}" ClearErrors FileOpen $0 "aeskulab21.ini" "r" GetTempFileName $R0 FileOpen $1 $R0 "w" loop: FileRead $0 $2 IfErrors done StrCmp $2 "DBTYPE=S$\r$\n" 0 +3 FileWrite $1 "DBTYPE=O$\r$\n" Goto loop StrCmp $2 "DBTYPE=S" 0 +3 FileWrite $1 "DBTYPE=O" Goto loop FileWrite $1 $2 Goto loop done: FileClose $0 FileClose $1 Delete "aeskulab21.ini" CopyFiles /SILENT $R0 "aeskulab21.ini" Delete $R0 StrCmp $R0 "1" done 0 ;DB = SQL oder MSDE StrCpy "$TYPE" "${type2}" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSInfo.ini" "Field 1" "Text" \ "Installationspfad:\r\n\r\n $R0 \r\n\r\n\r\nDatenbank:\r\n\r\n $TYPE" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSInfo.ini" "Field 2" "Text" "$_CLICK" !insertmacro MUI_HEADER_TEXT "Setup Informationen" "Hier sehen Sie noch einmal die wichtigsten Informationen im Überblick" !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioSInfo.ini" FunctionEnd Function ioStringConvert Exch $0 ; The source Push $1 ; The output Push $2 ; Temporary char StrCpy $1 "" ; Initialise the output loop: StrCpy $2 $0 1 ; Get the next source char StrCmp $2 "" done ; Abort when none left StrCpy $0 $0 "" 1 ; Remove it from the source StrCmp $2 "\" "" +3 ; Back-slash? StrCpy $1 "$1\\" Goto loop StrCmp $2 "$\r" "" +3 ; Carriage return? StrCpy $1 "$1\r" Goto loop StrCmp $2 "$\n" "" +3 ; Line feed? StrCpy $1 "$1\n" Goto loop StrCmp $2 "$\t" "" +3 ; Tab? StrCpy $1 "$1\t" Goto loop StrCpy $1 "$1$2" ; Anything else Goto loop done: StrCpy $0 $1 Pop $2 Pop $1 Exch $0 FunctionEnd ;-------------------------------- ;Installer Sections Section "OCX und DLLs" ;diese Dateien sind wichtig! ;WERDEN BEI ALLEN SETUP TYPEN ERSTELLT SetOutPath "$SYSDIR" ; jo, der /r parameter spart mal wieder jede menge schreibarbeit, und bleibt auserdem bei einer beliebigen, sich ändernden dateimenge neutral ; alle weiteren benutzten optionen (warum *.* da sein muss, und was /a und /nonfatal bedeuten) siehe nsis-user-manual unter "4.9.1.5 File") File /nonfatal /a /r "C:\NSIS PROJEKT\NSIS-Ä21\common\*.*" DetailPrint "----------------------------------------------------------------------------------" DetailPrint " Systemdateien kopiert" DetailPrint "----------------------------------------------------------------------------------" SectionEnd Section "ÄSKULAB21(Anwendung)" SecAnwendung ;DIESE SEKTION WIRD NUR BEIM LOKALEN SETUP ERSTELLT SetOutPath "$INSTDIR" File /nonfatal /a /r "C:\NSIS PROJEKT\NSIS-Ä21\lokal\*.*" WriteRegStr HKLM "SOFTWARE\AESKULAB21" "Install_Dir" "$INSTDIR" ; Write the uninstall keys for Windows WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AESKULAB21" "DisplayName" "ÄSKULAB21" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AESKULAB21" "UninstallString" "$INSTDIR\uninstall.exe" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AESKULAB21" "ModifyPath" "$INSTDIR\Uninstall.exe" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AESKULAB21" "NoModify" 1 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AESKULAB21" "NoRepair" 1 WriteUninstaller "$INSTDIR\uninstall.exe" DetailPrint "----------------------------------------------------------------------------------" DetailPrint " Anwendung erstellt und in Registry eingetragen" DetailPrint "----------------------------------------------------------------------------------" CreateDirectory "$INSTDIR\DB" SetOutPath "$INSTDIR\DB" File /nonfatal /a /r "CC:\NSIS PROJEKT\NSIS-Ä21\db\*.*" DetailPrint "----------------------------------------------------------------------------------" DetailPrint " Datenbank erstellt" DetailPrint "----------------------------------------------------------------------------------" CreateDirectory "$SMPROGRAMS\UniSoft\ÄSKULAB 21" CreateShortCut "$SMPROGRAMS\UniSoft\ÄSKULAB 21\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 CreateShortCut "$SMPROGRAMS\UniSoft\ÄSKULAB 21\ÄSKULAB21.lnk" "$INSTDIR\ÄSKULAB21.exe" "" "$INSTDIR\ÄSKULAB21.exe" 0 DetailPrint "----------------------------------------------------------------------------------" DetailPrint " Verknüpfungen im Startmenü erstellt" DetailPrint "----------------------------------------------------------------------------------" SectionEnd Section SetOutPath "$INSTDIR\ClientSetup" File /nonfatal /a "C:\NSIS PROJEKT\NSIS-Ä21\Ä21_CLIENT.exe" SectionEnd Section "Uninstall" ; Remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AESKULAB21" DeleteRegKey HKLM "Software\AESKULAB21" ; alle in den ordnern beinhalteten dateien werden durch den parameter "/r" automatisch gelöscht. das spart jede menge schreib-arbeit RMDir /r "$SMPROGRAMS\UniSoft" RMDir /r "$INSTDIR" SectionEnd