--- joko/ToolBox/Windows/VpnDial-installer/vpn.nsi 2005/11/18 19:44:44 1.1 +++ joko/ToolBox/Windows/VpnDial-installer/vpn.nsi 2005/11/21 19:55:43 1.2 @@ -1,12 +1,13 @@ ; VpnDial.nsi -; $Id: vpn.nsi,v 1.1 2005/11/18 19:44:44 joko Exp $ +; $Id: vpn.nsi,v 1.2 2005/11/21 19:55:43 joko Exp $ ; ; This script can install VpnDial, ; has uninstall support and (optionally) installs start menu shortcuts. ; -!include "connection.nsi" -!include "vpn_functions.nsi" +!include "MUI.nsh" +!include "parameter.nsi" +!include "file_functions.nsi" ; -------------------------------- @@ -25,21 +26,56 @@ InstallDirRegKey HKLM "Software\NSIS_VpnDial" "Install_Dir" ; more options: language of the installer & installer style -LoadLanguageFile "${NSISDIR}\Contrib\Language files\German.nlf" -XPStyle on +;LoadLanguageFile "${NSISDIR}\Contrib\Language files\German.nlf" +;XPStyle on + +SetOverwrite on ; -------------------------------- -; Pages +; (MUI) Interface Settings ; -------------------------------- +!define MUI_ABORTWARNING +!define MUI_COMPONENTSPAGE_NODESC +!define MUI_ICON "key.ico" +!define MUI_UNICON "key.ico" + -Page components -Page directory -Page instfiles +; -------------------------------- +; Pages +; -------------------------------- +;Page components +;Page directory +;Page instfiles UninstPage uninstConfirm UninstPage instfiles +;!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt" +!insertmacro MUI_PAGE_COMPONENTS +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES + +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_LANGUAGE "German" + + +; -------------------------------- +; .onInit +; -------------------------------- + +Function .onInit + +System::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex") i .r1 ?e' +Pop $R0 +StrCmp $R0 0 +3 + MessageBox MB_OK|MB_ICONEXCLAMATION "Die Installation läuft bereits." + Abort + +FunctionEnd + + ; -------------------------------- ; The stuff to install ; -------------------------------- @@ -53,12 +89,14 @@ Pop $1 #Found at all? yes/no Pop $2 #Number of lines found in StrCmp $1 yes 0 +3 - MessageBox MB_OK "$\"[$connectionname]$\" was found already found. Cannot create. Sorry." + MessageBox MB_OK "Die Verbindung $\"$connectionname$\" existiert bereits. Der Eintrag kann leider nicht doppelt angelegt werden." Abort SectionEnd Section "VpnDial" IDX_VpnDial + SetOverwrite on + SetDetailsPrint both DetailPrint "Installiere VpnDial..." @@ -70,11 +108,8 @@ ;CreateDirectory $INSTDIR\certs\ ; Put file there - ;File /r "C:\IPSec\nsis\vpndial\*.*" File /r "vpndial\*.*" - ;File "C:\IPSec\nsis\vpndial\certs\" - ;File "C:\IPSec\nsis\vpndial\certs\*.*" - + ; Write the installation path into the registry WriteRegStr HKLM Software\NSIS_VpnDial "Install_Dir" "$INSTDIR" @@ -130,7 +165,7 @@ SectionEnd ; Optional section (can be disabled by the user) -Section "Start Menu Shortcuts" IDX_STARTMENU +Section "Startmenü-Einträge" IDX_STARTMENU SetDetailsPrint both DetailPrint "Installiere Startmenü-Einträge und Desktop-Verknüpfungen..." @@ -142,15 +177,14 @@ ;CreateShortCut "$SMPROGRAMS\VpnDial\VpnSetup.lnk" "$INSTDIR\bin\VpnDial.exe" "--setup $connectionname --user $username --pass $userpass" "$INSTDIR\bin\VpnDial.exe" 0 CreateShortCut "$SMPROGRAMS\VpnDial\Zertifikate.lnk" "$INSTDIR\certs\" "" "$INSTDIR\certs\" 0 CreateShortCut "$SMPROGRAMS\VpnDial\ZertifikatsVerwaltung.lnk" "$INSTDIR\links\IPSec.msc" "" "$INSTDIR\links\IPSec.msc" 0 - CreateShortCut "$SMPROGRAMS\VpnDial\README.lnk" "$INSTDIR\doc\README.txt" "" "$INSTDIR\doc\README.txt" 0 - CreateShortCut "$SMPROGRAMS\VpnDial\README-HTML.lnk" "$INSTDIR\doc\README.htm" "" "$INSTDIR\doc\README.htm" 0 + ;CreateShortCut "$SMPROGRAMS\VpnDial\README.lnk" "$INSTDIR\doc\README.txt" "" "$INSTDIR\doc\README.txt" 0 + ;CreateShortCut "$SMPROGRAMS\VpnDial\README-HTML.lnk" "$INSTDIR\doc\README.htm" "" "$INSTDIR\doc\README.htm" 0 CopyFiles "$INSTDIR\links\Netzwerkverbindung*" "$SMPROGRAMS\VpnDial\" SectionEnd - ; -------------------------------- ; Uninstaller ; --------------------------------