new makensis installer

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@786 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
rainwater 2002-08-28 19:45:45 +00:00
parent 4e879c92c3
commit a10253a913

View file

@ -1,40 +1,34 @@
!define VER_MAJOR 2 !define VER_MAJOR 2
!define VER_MINOR 0a7 !define VER_MINOR 0a7
!define NAME "NSIS"
!ifdef NO_COMPRESSION !verbose 3
SetCompress off !include "${NSISDIR}\Examples\WinMessages.nsh"
SetDatablockOptimize off !verbose 4
!endif
!ifdef NO_CRC !define CURRENTPAGE $9
CRCCheck off !define TEMP1 $R0
!endif !define TEMP2 $R1
Name "NSIS" Name "NSIS"
Caption "Nullsoft Install System - Setup" Caption "Nullsoft Install System - Setup"
OutFile ..\nsis${VER_MAJOR}${VER_MINOR}.exe OutFile ..\nsis${VER_MAJOR}${VER_MINOR}.exe
SetCompressor bzip2 SetCompressor bzip2
!ifdef uglyinstaller InstallColors /windows
BGGradient 000000 308030 FFFFFF InstProgressFlags smooth
InstallColors FF8080 000000
InstProgressFlags smooth colored
!else
XPStyle on XPStyle on
WindowIcon off ChangeUI all "${NSISDIR}\Contrib\UIs\modernsimple.exe"
!endif SetFont Tahoma 8
CheckBitmap "${NSISDIR}\Contrib\Icons\modern.bmp"
!ifdef NSIS_CONFIG_LICENSEPAGE LicenseText "Scroll down to see the rest of the agreement."
LicenseText "You must read the following license before installing:"
LicenseData ..\license.txt LicenseData ..\license.txt
!endif
!ifdef NSIS_CONFIG_COMPONENTPAGE
ComponentText "This will install the Nullsoft Install System v${VER_MAJOR}.${VER_MINOR} on your computer:" ComponentText "This will install the Nullsoft Install System v${VER_MAJOR}.${VER_MINOR} on your computer:"
InstType "Full (w/ Source and Contrib)" InstType "Full"
InstType "Normal (w/ Contrib, w/o Source)" InstType "Normal"
InstType "Lite (w/o Source or Contrib)" InstType "Lite"
!endif
AutoCloseWindow false AutoCloseWindow false
ShowInstDetails show ShowInstDetails show
@ -42,9 +36,6 @@ ShowUninstDetails show
DirText "Please select a location to install NSIS (or use the default):" DirText "Please select a location to install NSIS (or use the default):"
SetOverwrite on SetOverwrite on
SetDateSave on SetDateSave on
!ifdef HAVE_UPX
!packhdr tmp.dat "upx\upx --best --compress-icons=1 tmp.dat"
!endif
InstallDir $PROGRAMFILES\NSIS InstallDir $PROGRAMFILES\NSIS
InstallDirRegKey HKLM SOFTWARE\NSIS "" InstallDirRegKey HKLM SOFTWARE\NSIS ""
@ -128,10 +119,7 @@ Section "Start Menu + Desktop Icons"
CreateShortCut "$DESKTOP\MakeNSIS.lnk" "$INSTDIR\Makensisw.exe" '"$INSTDIR\makensis.exe" /CD' CreateShortCut "$DESKTOP\MakeNSIS.lnk" "$INSTDIR\Makensisw.exe" '"$INSTDIR\makensis.exe" /CD'
SectionEnd SectionEnd
!ifndef NO_CONTRIB
SubSection "Contrib" SubSection "Contrib"
Section "Extra Icons" Section "Extra Icons"
SectionIn 1 2 SectionIn 1 2
SetOutPath $INSTDIR\Contrib\Icons SetOutPath $INSTDIR\Contrib\Icons
@ -252,16 +240,10 @@ Section "NSIS-DL"
CreateShortCut "$SMPROGRAMS\NSIS\Contrib\NSIS-DL project workspace.lnk" "$INSTDIR\contrib\NSISDL\nsisdl.dsw" CreateShortCut "$SMPROGRAMS\NSIS\Contrib\NSIS-DL project workspace.lnk" "$INSTDIR\contrib\NSISDL\nsisdl.dsw"
NoShortCuts: NoShortCuts:
SectionEnd SectionEnd
SubSectionEnd SubSectionEnd
!endif
!ifndef NO_SOURCE
SubSection "Source code" SubSection "Source code"
Section "NSIS Source Code" Section "NSIS Source Code"
SectionIn 1 SectionIn 1
DetailPrint "Extracting source code...." DetailPrint "Extracting source code...."
@ -298,7 +280,6 @@ Section "NSIS Source Code"
SectionEnd SectionEnd
SubSection "Contrib" SubSection "Contrib"
Section "ExDLL Source" Section "ExDLL Source"
SectionIn 1 SectionIn 1
SetOutPath $INSTDIR\Contrib\ExDLL SetOutPath $INSTDIR\Contrib\ExDLL
@ -331,13 +312,9 @@ Section "MakeNSISW Source"
CreateShortCut "$SMPROGRAMS\NSIS\Contrib\MakeNSISW readme.lnk" "$INSTDIR\contrib\MakeNsisw\readme.txt" CreateShortCut "$SMPROGRAMS\NSIS\Contrib\MakeNSISW readme.lnk" "$INSTDIR\contrib\MakeNsisw\readme.txt"
NoShortCuts: NoShortCuts:
SectionEnd SectionEnd
SubSectionEnd SubSectionEnd
SubSectionEnd SubSectionEnd
!endif
Section -post Section -post
WriteRegStr HKLM SOFTWARE\NSIS "" $INSTDIR WriteRegStr HKLM SOFTWARE\NSIS "" $INSTDIR
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "DisplayName" "NSIS Development Kit (remove only)" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "DisplayName" "NSIS Development Kit (remove only)"
@ -348,10 +325,10 @@ Section -post
Sleep 500 Sleep 500
BringToFront BringToFront
nofunshit: nofunshit:
; since the installer is now created last (in 1.2+), this makes sure
; that any old installer that is readonly is overwritten.
Delete $INSTDIR\uninst-nsis.exe Delete $INSTDIR\uninst-nsis.exe
WriteUninstaller $INSTDIR\uninst-nsis.exe WriteUninstaller $INSTDIR\uninst-nsis.exe
IntOp ${CURRENTPAGE} ${CURRENTPAGE} + 1
Call SetHeader
SectionEnd SectionEnd
Function .onInstSuccess Function .onInstSuccess
@ -360,7 +337,84 @@ Function .onInstSuccess
NoReadme: NoReadme:
FunctionEnd FunctionEnd
!ifndef NO_UNINST Function .onInitDialog
Push ${TEMP1}
FindWindow ${TEMP1} "#32770" "" $HWNDPARENT
StrCmp ${CURRENTPAGE} 1 "" +4
GetDlgItem ${TEMP1} ${TEMP1} 1040
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "If you accept all the terms of the agreement, choose I Agree to continue. If you choose Cancel, Setup will close. You must accept the agreement to install ${NAME}."
Goto done
StrCmp ${CURRENTPAGE} 2 "" +4
GetDlgItem ${TEMP1} ${TEMP1} 1042
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Description"
Goto done
StrCmp ${CURRENTPAGE} 3 "" +3
GetDlgItem ${TEMP1} ${TEMP1} 1041
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Destination Folder"
done:
Pop ${TEMP1}
FunctionEnd
Function .onNextPage
Push ${TEMP1}
Push ${TEMP2}
StrCmp ${CURRENTPAGE} "" "" no_set_outer
GetDlgItem ${TEMP1} $HWNDPARENT 1037
CreateFont ${TEMP2} "Tahoma" 16 1000
SendMessage ${TEMP1} ${WM_SETFONT} ${TEMP2} 0
SetStaticBkColor ${TEMP1} 0x00FFFFFF
GetDlgItem ${TEMP1} $HWNDPARENT 1038
SetStaticBkColor ${TEMP1} 0x00FFFFFF
GetDlgItem ${TEMP1} $HWNDPARENT 1034
SetStaticBkColor ${TEMP1} 0x00FFFFFF
GetDlgItem ${TEMP1} $HWNDPARENT 1039
SetStaticBkColor ${TEMP1} 0x00FFFFFF
no_set_outer:
IntOp ${CURRENTPAGE} ${CURRENTPAGE} + 1
Call SetHeader
Pop ${TEMP2}
Pop ${TEMP1}
FunctionEnd
Function .onPrevPage
IntOp ${CURRENTPAGE} ${CURRENTPAGE} - 1
Call SetHeader
FunctionEnd
Function SetHeader
Push ${TEMP1}
Push ${TEMP2}
GetDlgItem ${TEMP1} $HWNDPARENT 1037
GetDlgItem ${TEMP2} $HWNDPARENT 1038
StrCmp ${CURRENTPAGE} 1 "" +4
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "License Agreement"
SendMessage ${TEMP2} ${WM_SETTEXT} 0 "Please review the license terms before installing ${NAME}."
Goto done
StrCmp ${CURRENTPAGE} 2 "" +4
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Choose Components"
SendMessage ${TEMP2} ${WM_SETTEXT} 0 "Choose the components you want to install."
Goto done
StrCmp ${CURRENTPAGE} 3 "" +4
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Choose Install Location"
SendMessage ${TEMP2} ${WM_SETTEXT} 0 "Choose the folder in which to install ${NAME} in."
Goto done
StrCmp ${CURRENTPAGE} 4 "" +4
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Installing"
SendMessage ${TEMP2} ${WM_SETTEXT} 0 "Please wait while ${NAME} is being installed."
Goto done
StrCmp ${CURRENTPAGE} 5 "" +3
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Finished"
SendMessage ${TEMP2} ${WM_SETTEXT} 0 "Setup was completed successfully."
done:
Pop ${TEMP1}
Pop ${TEMP2}
FunctionEnd
Function .onUserAbort
MessageBox MB_YESNO|MB_ICONQUESTION "Are you sure you want to quit the NSIS Setup?" IDYES quit
Abort
quit:
FunctionEnd
UninstallText "This will uninstall NSIS from your system:" UninstallText "This will uninstall NSIS from your system:"
@ -448,6 +502,48 @@ Section Uninstall
IfFileExists $INSTDIR 0 Removed IfFileExists $INSTDIR 0 Removed
MessageBox MB_OK|MB_ICONEXCLAMATION "Note: $INSTDIR could not be removed." MessageBox MB_OK|MB_ICONEXCLAMATION "Note: $INSTDIR could not be removed."
Removed: Removed:
IntOp ${CURRENTPAGE} ${CURRENTPAGE} + 1
Call un.SetHeader
SectionEnd SectionEnd
!endif Function un.onNextPage
Push ${TEMP1}
Push ${TEMP2}
StrCmp ${CURRENTPAGE} "" "" no_set_outer
GetDlgItem ${TEMP1} $HWNDPARENT 1037
CreateFont ${TEMP2} "Tahoma" 16 1000
SendMessage ${TEMP1} ${WM_SETFONT} ${TEMP2} 0
SetStaticBkColor ${TEMP1} 0x00FFFFFF
GetDlgItem ${TEMP1} $HWNDPARENT 1038
SetStaticBkColor ${TEMP1} 0x00FFFFFF
GetDlgItem ${TEMP1} $HWNDPARENT 1034
SetStaticBkColor ${TEMP1} 0x00FFFFFF
GetDlgItem ${TEMP1} $HWNDPARENT 1039
SetStaticBkColor ${TEMP1} 0x00FFFFFF
no_set_outer:
IntOp ${CURRENTPAGE} ${CURRENTPAGE} + 1
Call un.SetHeader
Pop ${TEMP2}
Pop ${TEMP1}
FunctionEnd
Function un.SetHeader
Push ${TEMP1}
Push ${TEMP2}
GetDlgItem ${TEMP1} $HWNDPARENT 1037
GetDlgItem ${TEMP2} $HWNDPARENT 1038
StrCmp ${CURRENTPAGE} 1 "" +4
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Uninstall ${NAME}"
SendMessage ${TEMP2} ${WM_SETTEXT} 0 "Remove ${NAME} from your system."
Goto done
StrCmp ${CURRENTPAGE} 2 "" +4
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Uninstalling"
SendMessage ${TEMP2} ${WM_SETTEXT} 0 "Please wait while ${NAME} is being uninstalled."
Goto done
StrCmp ${CURRENTPAGE} 3 "" +3
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Finished"
SendMessage ${TEMP2} ${WM_SETTEXT} 0 "${NAME} has been removed from your system."
done:
Pop ${TEMP2}
Pop ${TEMP1}
FunctionEnd