; 9 23 2003: Lichun Jia ; generate NSIS XTier installer ; ------------------------------- ; Start Name "XTier" !define MUI_PRODUCT "XTier installer" !define MUI_VERSION "1.0" ; !define MUI_BRANDINGTEXT "EasyPoint 3 beta 1.0"; CRCCheck On !include "${NSISDIR}\Contrib\Modern UI\System.nsh" ;-------------------------------- ;General OutFile "XTierInstaller.exe" ShowInstDetails "nevershow" ShowUninstDetails "nevershow" ; SetCompressor "bzip2" ; may need change it to be ZLib(default). compression is always used on bzip2 installers ; SetCompress auto !define MUI_ICON "icon.ico" !define MUI_UNICON "icon.ico" !define MUI_SPECIALBITMAP "Bitmap1.bmp" ;bitmap for the welcome and finish page ;-------------------------------- ;Folder selection page InstallDir "$PROGRAMFILES\${MUI_PRODUCT}" ;//default installation directory ;IIS registry key is checked, and INSTDIR will be reset InstallDirRegKey HKLM "SYSTEM\CurrentControlSet\Control\ServiceProvider\ServiceTypes\Microsoft Internet Information Server" "" ; InstallDirRegKey HKLM "SOFTWARE\Client" "aaa" !define SYSTEM_DRIVE "c:\" ;change it to be ROOT_DRIVE ;-------------------------------- ;Modern UI Configuration ; !insertmacro MUI_WELCOMEPAGE "" ;might need file name for all the pages. !define MUI_WELCOMEPAGE ; we do not need this !define MUI_LICENSEPAGE !define MUI_DIRECTORYPAGE !define MUI_ABORTWARNING !define MUI_UNINSTALLER !define MUI_UNCONFIRMPAGE !define MUI_FINISHPAGE ;-------------------------------- ;Modern UI System ; !insertmacro MUI_SYSTEM ;-------------------------------- ;Language ; !insertmacro MUI_LANGUAGE "English" ;ZipDll unzips a zip file !include "${NSISDIR}\Contrib\Modern UI\ZipDLL.nsh" ;-------------------------------- ;Data ;-------------------------------- ;Installer Sections Section "install" Installation info ;add XTier install exes SetOutPath "$INSTDIR" File "CrtVdir.exe" File "xtregcln.exe" ;ZipDLL unzips the zip file !insertmacro MUI_ZIPDLL_EXTRACTALL "c:\mywork\xtier3.1\xtier\installation\win32\debug\xtier_win32.zip" "$SYSDIR" !insertmacro MUI_ZIPDLL_EXTRACTFILE "c:\mywork\xtier3.1\xtier\installation\win32\debug\xtier_win32.zip" "${SYSTEM_DRIVE}\oneNet" "oneNet.dll" ;add XTier binaries in places ; SetOutPath "$SYSDIR" ; file /r "$PROGRAMFILES\${MUI_PRODUCT}"\system32\*.* ; SetOutPath "${SYSTEM_DRIVE}" ; file /r oneNet ;create desktop shortcut ; CreateShortCut "$DESKTOP\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" "" ;Create Virtual Roots, applications, and filters for IIS ExecWait '"CrtVdir.exe" CD "${SYSTEM_DRIVE}"\oneNet oneNet 5 1' ExecWait '"CrtVdir.exe" CA w3svc/1/root/oneNet INPROC *,"${SYSTEM_DRIVE}"\oneNet\oneNet.dll,1' ExecWait '"CrtVdir.exe" CF oneNet "$SYSDIR"\inetsrv\\xtiisflt.dll' ;Restart IIS... ExecWait '"iisreset.exe" /restart' ;Register dlls to IIS server ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\ncplw32' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\dm' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\dmndap' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\eventmgr' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\hostbyname' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\ipctlnt' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\ncfswin32' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\nciom' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\ncp' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\ncpfsp' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\nds4' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\ndslpp' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\niam' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\nscm' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\nsns' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\svccost' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\vls' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\xtlmauth' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\xtlog' ExecWait '"regsvr32.exe" /s "$SYSDIR"\Novell\xtutilwin32' ExecWait '"regsvr32.exe" /s "${SYSTEM_DRIVE}"\oneNet\oneNet' ;Replay other registry changes ExecWait '"regedit.exe" /s xt.reg' ;Restart IIS again ExecWait '"iisreset" /restart' ;create start-menu items ; CreateDirectory "$SMPROGRAMS\${MUI_PRODUCT}" CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 ; CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" "" "$INSTDIR\${MUI_FILE}.exe" 0 ;write uninstall information to the registry ; WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "DisplayName" "${MUI_PRODUCT} (remove only)" ; WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "UninstallString" "$INSTDIR\Uninstall.exe" WriteUninstaller "$INSTDIR\uninstall.exe" SectionEnd ;-------------------------------- ;Uninstaller Section Section "uninstall" ;Delete Start Menu Shortcuts Delete "$SMPROGRAMS\${MUI_PRODUCT}\*.*" RmDir "$SMPROGRAMS\${MUI_PRODUCT}" ;Delete virtual directories for IIS ExecWait '"CrtVdir.exe" RA w3svc/1/root/oneNet' ExecWait '"CrtVdir.exe" RD oneNet' ExecWait '"CrtVdir.exe" RF oneNet' ;Stop IIS ExecWait '"iisreset.exe" /stop' ;UnRegister dlls from IIS server ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\ncplw32' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\dm' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\dmndap' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\eventmgr' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\hostbyname' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\ipctlnt' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\ncfswin32' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\nciom' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\ncp' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\ncpfsp' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\nds4' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\ndslpp' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\niam' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\nscm' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\nsns' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\svccost' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\vls' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\xtlmauth' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\xtlog' ExecWait '"regsvr32.exe" /s /u "$SYSDIR"\Novell\xtutilwin32' ExecWait '"regsvr32.exe" /s /u "${SYSTEM_DRIVE}"\oneNet\oneNet' ;Start IIS ExecWait '"iisreset.exe" /start' ;Delete other registry changes for XTier ExecWait '"xtregcln.exe"' ;Delete the install directory RmDir -r "$INSTDIR" SectionEnd ;-------------------------------- ;MessageBox Section ;Function that calls a messagebox when installation finished correctly Function .onInstSuccess MessageBox MB_OK "You have successfully installed ${MUI_PRODUCT}." FunctionEnd Function un.onUninstSuccess MessageBox MB_OK "You have successfully uninstalled ${MUI_PRODUCT}." FunctionEnd Function .onInit MessageBox MB_OK 'debug: instdir is "$INSTDIR"' StrCmp "$INSTDIR" "" Continue ;INSTDIR is set by InstallDirRegKey MessageBox MB_OK "IIS (Internet Information System) is not installed on this system. Installation aborted." Abort Continue: MessageBox MB_OK $INSTDIR MessageBox MB_OK "debug: IIS is installed on this system. continue." Abort StrCpy $INSTDIR "$PROGRAMFILES\${MUI_PRODUCT}" FunctionEnd ;eof