file association, section macros, fixes

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3251 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
joostverburg 2003-12-04 16:28:13 +00:00
parent e15be55ca7
commit 85fef2cde5

View file

@ -31,8 +31,10 @@ InstallDirRegKey HKLM Software\NSIS ""
;-------------------------------- ;--------------------------------
;Include Modern UI ;Header Files
!include "MUI.nsh" !include "MUI.nsh"
!include "Sections.nsh"
;-------------------------------- ;--------------------------------
;Configuration ;Configuration
@ -86,8 +88,6 @@ Page custom PageReinstall PageLeaveReinstall
;-------------------------------- ;--------------------------------
;Installer Sections ;Installer Sections
!define SF_SELECTED 1
Section "NSIS Core Files (required)" SecCore Section "NSIS Core Files (required)" SecCore
SetDetailsPrint textonly SetDetailsPrint textonly
@ -240,7 +240,7 @@ SubSection "User Interfaces" SecInterfaces
Section "Modern User Interface" SecInterfacesModernUI Section "Modern User Interface" SecInterfacesModernUI
SetDetailsPrint textonly SetDetailsPrint textonly
DetailPrint "Installing Interfaces | Modern User Interface..." DetailPrint "Installing User Interfaces | Modern User Interface..."
SetDetailsPrint listonly SetDetailsPrint listonly
SectionIn 1 2 3 SectionIn 1 2 3
@ -286,7 +286,7 @@ SectionEnd
Section "Default User Interface" SecInterfacesDefaultUI Section "Default User Interface" SecInterfacesDefaultUI
SetDetailsPrint textonly SetDetailsPrint textonly
DetailPrint "Installing Interfaces | Default User Interface..." DetailPrint "Installing User Interfaces | Default User Interface..."
SetDetailsPrint listonly SetDetailsPrint listonly
SectionIn 1 2 SectionIn 1 2
@ -299,7 +299,7 @@ SectionEnd
Section "Tiny User Interface" SecInterfacesTinyUI Section "Tiny User Interface" SecInterfacesTinyUI
SetDetailsPrint textonly SetDetailsPrint textonly
DetailPrint "Installing Interfaces | Tiny User Interface..." DetailPrint "Installing User Interfaces | Tiny User Interface..."
SetDetailsPrint listonly SetDetailsPrint listonly
SectionIn 1 2 SectionIn 1 2
@ -311,7 +311,7 @@ SectionEnd
SubSectionEnd SubSectionEnd
Section "Graphics" SecPluginsGraphics Section "Graphics" SecGraphics
SetDetailsPrint textonly SetDetailsPrint textonly
DetailPrint "Installing Graphics..." DetailPrint "Installing Graphics..."
@ -327,10 +327,10 @@ Section "Graphics" SecPluginsGraphics
File /r "..\Contrib\Graphics\*.bmp" File /r "..\Contrib\Graphics\*.bmp"
SectionEnd SectionEnd
Section "Language files" SecPluginsLang Section "Language Files" SecLangFiles
SetDetailsPrint textonly SetDetailsPrint textonly
DetailPrint "Installing Language files..." DetailPrint "Installing Language Files..."
SetDetailsPrint listonly SetDetailsPrint listonly
SectionIn 1 2 SectionIn 1 2
@ -341,11 +341,10 @@ Section "Language files" SecPluginsLang
SetOutPath $INSTDIR\Bin SetOutPath $INSTDIR\Bin
File ..\Bin\MakeLangID.exe File ..\Bin\MakeLangID.exe
SectionGetFlags ${SecInterfacesModernUI} $R0 !insertmacro SectionFlagIsSet ${SecInterfacesModernUI} ${SF_SELECTED} mui nomui
IntOp $R0 $R0 & ${SF_SELECTED} mui:
IntCmp $R0 ${SF_SELECTED} 0 nomui nomui SetOutPath "$INSTDIR\Contrib\Modern UI\Language files"
SetOutPath "$INSTDIR\Contrib\Modern UI\Language files" File "..\Contrib\Modern UI\Language files\*.nsh"
File "..\Contrib\Modern UI\Language files\*.nsh"
nomui: nomui:
SectionEnd SectionEnd
@ -983,32 +982,38 @@ Section -post
; * Always install the English language file ; * Always install the English language file
; * Always install default icons / bitmaps ; * Always install default icons / bitmaps
SectionGetFlags ${SecInterfacesModernUI} $R0 !insertmacro SectionFlagIsSet ${SecInterfacesModernUI} ${SF_SELECTED} mui nomui
IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} "" nomui nomui mui:
SetDetailsPrint textonly SetDetailsPrint textonly
DetailPrint "Configurating Modern UI..." DetailPrint "Configurating Modern UI..."
SetDetailsPrint listonly SetDetailsPrint listonly
!insertmacro SectionFlagIsSet ${SecLangFiles} ${SF_SELECTED} langfiles nolangfiles
SectionGetFlags ${SecPluginsLang} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} langfiles
nolangfiles:
SetOutPath "$INSTDIR\Contrib\Language files"
File "..\Contrib\Language files\English.nlf"
SetOutPath "$INSTDIR\Contrib\Modern UI\Language files" SetOutPath "$INSTDIR\Contrib\Modern UI\Language files"
File "..\Contrib\Modern UI\Language files\Default.nsh"
File "..\Contrib\Modern UI\Language files\English.nsh" File "..\Contrib\Modern UI\Language files\English.nsh"
langfiles: langfiles:
SectionGetFlags ${SecPluginsGraphics} $R0 !insertmacro SectionFlagIsSet ${SecGraphics} ${SF_SELECTED} graphics nographics
IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} graphics nographics:
SetOutPath $INSTDIR\Contrib\Graphics SetOutPath $INSTDIR\Contrib\Graphics
SetOutPath $INSTDIR\Contrib\Graphics\Checks
File "..\Contrib\Graphics\Checks\modern.bmp"
SetOutPath $INSTDIR\Contrib\Graphics\Icons SetOutPath $INSTDIR\Contrib\Graphics\Icons
File "..\Contrib\Graphics\Icons\modern-install.ico" File "..\Contrib\Graphics\Icons\modern-install.ico"
File "..\Contrib\Graphics\Icons\modern-uninstall.ico" File "..\Contrib\Graphics\Icons\modern-uninstall.ico"
SetOutPath $INSTDIR\Contrib\Graphics\Header
File "..\Contrib\Graphics\Header\nsis.bmp"
SetOutPath $INSTDIR\Contrib\Graphics\Wizard SetOutPath $INSTDIR\Contrib\Graphics\Wizard
File "..\Contrib\Graphics\Wizard\win.bmp" File "..\Contrib\Graphics\Wizard\win.bmp"
@ -1171,8 +1176,7 @@ Section -post
SetDetailsPrint none SetDetailsPrint none
RMDir $INSTDIR\Contrib\Source RMDir $INSTDIR\Contrib\Source
SetDetailsPrint lastused SetDetailsPrint lastused
Delete $INSTDIR\uninst-nsis.exe
WriteUninstaller $INSTDIR\uninst-nsis.exe WriteUninstaller $INSTDIR\uninst-nsis.exe
SetDetailsPrint both SetDetailsPrint both
@ -1195,8 +1199,8 @@ SectionEnd
!insertmacro MUI_DESCRIPTION_TEXT ${SecToolsUpdate} "A tool that lets you check for new NSIS releases and download the latest development files" !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsUpdate} "A tool that lets you check for new NSIS releases and download the latest development files"
!insertmacro MUI_DESCRIPTION_TEXT ${SecToolsZ2E} "A utility that converts a ZIP file to a NSIS installer" !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsZ2E} "A utility that converts a ZIP file to a NSIS installer"
!insertmacro MUI_DESCRIPTION_TEXT ${SecToolsZ2ES} "Source code to a utility that converts a ZIP file to a NSIS installer" !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsZ2ES} "Source code to a utility that converts a ZIP file to a NSIS installer"
!insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGraphics} "Icons, checkbox images and other graphics" !insertmacro MUI_DESCRIPTION_TEXT ${SecGraphics} "Icons, checkbox images and other graphics"
!insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsLang} "Language files used to support multiple languages in an installer" !insertmacro MUI_DESCRIPTION_TEXT ${SecLangFiles} "Language files used to support multiple languages in an installer"
!insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsPlugins} "Useful plugins that extend NSIS's functionality" !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsPlugins} "Useful plugins that extend NSIS's functionality"
!insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsPluginsS} "Source code for plugins" !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsPluginsS} "Source code for plugins"
!insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBanner} "Plugin that lets you show a banner before installation starts" !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBanner} "Plugin that lets you show a banner before installation starts"
@ -1403,40 +1407,28 @@ Section Uninstall
DetailPrint "Uninstalling NSI Development Shell Extensions..." DetailPrint "Uninstalling NSI Development Shell Extensions..."
SetDetailsPrint listonly SetDetailsPrint listonly
IfFileExists $INSTDIR\makensis.exe skip_confirmation IfFileExists $INSTDIR\makensis.exe nsis_installed
MessageBox MB_YESNO "It does not appear that NSIS is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)" IDYES skip_confirmation MessageBox MB_YESNO "It does not appear that NSIS is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?" IDYES nsis_installed
Abort "Uninstall aborted by user" Abort "Uninstall aborted by user"
skip_confirmation: nsis_installed:
ReadRegStr $1 HKCR ".nsi" ""
StrCmp $1 "NSISFile" 0 NoOwn ; only do this if we own it
ReadRegStr $1 HKCR ".nsi" "backup_val"
StrCmp $1 "" 0 RestoreBackup ; if backup == "" then delete the whole key
DeleteRegKey HKCR ".nsi"
Goto NoOwn
RestoreBackup:
WriteRegStr HKCR ".nsi" "" $1
DeleteRegValue HKCR ".nsi" "backup_val"
NoOwn:
ReadRegStr $1 HKCR ".nsh" ""
StrCmp $1 "NSHFile" 0 NoOwn2 ; only do this if we own it
ReadRegStr $1 HKCR ".nsh" "backup_val"
StrCmp $1 "" 0 RestoreBackup2 ; if backup == "" then delete the whole key
DeleteRegKey HKCR ".nsh"
Goto NoOwn
RestoreBackup2:
WriteRegStr HKCR ".nsh" "" $1
DeleteRegValue HKCR ".nsh" "backup_val"
NoOwn2:
SetDetailsPrint textonly SetDetailsPrint textonly
DetailPrint "Deleting Registry Keys..." DetailPrint "Deleting Registry Keys..."
SetDetailsPrint listonly SetDetailsPrint listonly
ReadRegStr $R0 HKCR ".nsi" ""
StrCmp $R0 "NSIS.Script" 0 +2
DeleteRegKey HKCR ".nsi"
ReadRegStr $R0 HKCR ".nsh" ""
StrCmp $R0 "NSIS.Header" 0 +2
DeleteRegKey HKCR ".nsh"
DeleteRegKey HKCR "NSISFile" DeleteRegKey HKCR "NSIS.Script"
DeleteRegKey HKCR "NSHFile" DeleteRegKey HKCR "NSIS.Header"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS"
DeleteRegKey HKLM SOFTWARE\NSIS DeleteRegKey HKLM "Software\NSIS"
SetDetailsPrint textonly SetDetailsPrint textonly
DetailPrint "Deleting Files..." DetailPrint "Deleting Files..."