Patch #911 2006-03-09 17:02

sethjackson

NSIS lexer
Download
911-NSIS_lexer.patch (3.3 KB)
Category
Lexer
Status
Accepted
Close date
2006-03-13 09:57
Assigned to
 
Index: src/sdk/resources/lexers/lexer_nsis.sample
===================================================================
--- src/sdk/resources/lexers/lexer_nsis.sample    (revision 2164)
+++ src/sdk/resources/lexers/lexer_nsis.sample    (working copy)
@@ -19,7 +19,13 @@
     Name "Example"
     OutFile "setup.exe"
     InstallDir $PROGRAMFILES\Example
+    InstallDirRegKey HKLM "Software\Example" ""
 
+;----------------------------------------
+;Variables
+
+  Var STARTMENU_FOLDER
+
 ;-----------------------------------------
 ;Interface Settings
 
@@ -31,6 +37,10 @@
 
     !insertmacro MUI_PAGE_WELCOME
     !insertmacro MUI_PAGE_DIRECTORY
+    !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
+    !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Example"
+    !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Example"
+    !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
     !insertmacro MUI_PAGE_INSTFILES
     !define MUI_FINISHPAGE_NOREBOOTSUPPORT
     !insertmacro MUI_PAGE_FINISH
@@ -49,23 +59,43 @@
 ;-----------------------------------------
 ;Installer Section
 
-    Section "Install"
+Section "Install"
+
+    WriteRegStr HKLM "Software\Example" "Install_Dir" $INSTDIR
+    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example" "DisplayIcon" $INSTDIR\uninstall.exe,0
+    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example" "DisplayName" "Example"
+    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example" "InstallLocation" $INSTDIR
+    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example" "NoModify" 1
+    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example" "NoRepair" 1
+    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example" "UninstallString" $INSTDIR\uninstall.exe
 
-        !insertmacro MUI_STARTMENU_WRITE_END
+    !insertmacro MUI_STARTMENU_WRITE_BEGIN "Application"
 
-        SetOutPath "$INSTDIR"
+    CreateDirectory $SMPROGRAMS\$STARTMENU_FOLDER
+    CreateShortCut $SMPROGRAMS\$STARTMENU_FOLDER\Uninstall Example.lnk $INSTDIR\uninstall.exe
 
-        WriteUninstaller "uninstall.exe"
+    !insertmacro MUI_STARTMENU_WRITE_END
 
-    SectionEnd
+    SetOutPath $INSTDIR
 
+    WriteUninstaller "uninstall.exe"
+
+SectionEnd
+
 ;-----------------------------------------
 ;Uninstaller Section
+
+Section "Uninstall"
+
+    DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example"
+    DeleteRegKey HKLM "Software\Example"
 
-    Section "Uninstall"
+    !insertmacro MUI_STARTMENU_GETFOLDER "Application" $STARTMENU_FOLDER
 
-        Delete "$INSTDIR\uninstall.exe"
+    RMDir /r $SMPROGRAMS\$STARTMENU_FOLDER
 
-        RMDir "$INSTDIR"
+    Delete $INSTDIR\uninstall.exe
 
-    SectionEnd
+    RMDir $INSTDIR
+
+SectionEnd
Index: src/sdk/resources/lexers/lexer_nsis.xml
===================================================================
--- src/sdk/resources/lexers/lexer_nsis.xml    (revision 2164)
+++ src/sdk/resources/lexers/lexer_nsis.xml    (working copy)
@@ -29,7 +29,7 @@
                         bold="1"/>
                 <Style name="Variable"
                         index="6"
-                        fg="158,0,0"/>
+                        fg="160,0,0"/>
                 <Style name="Label"
                         index="7"
                         fg="224,160,0"/>