Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add start menu entries.

  • Loading branch information...
commit 79123f1e78c022d8de4d7b4432c3cfebd9bb610a 1 parent 49d9576
Jonathan Protzenko authored September 13, 2011

Showing 2 changed files with 32 additions and 10 deletions. Show diff stats Hide diff stats

  1. 37  install.nsi
  2. 5  onlinedoc.url
37  install.nsi
@@ -33,6 +33,11 @@ RequestExecutionLevel admin
33 33
 !define MUI_FINISHPAGE_TITLE "Congratulations! You have installed OCaml"
34 34
 !define MUI_FINISHPAGE_TEXT "You can now play with OCaml. Start menu entries and desktop shortcuts have been created. You can either run OCamlWin, which is old and clunky, or run Emacs, if you chose to install it. Once in Emacs, just hit Alt-X, type run-caml, hit enter, and start playing with the toplevel. Enjoy!"
35 35
 !define MUI_WELCOMEFINISHPAGE_BITMAP "side.bmp"
  36
+!define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX"
  37
+!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\OCaml"
  38
+!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
  39
+
  40
+Var STARTMENUFOLDER
36 41
 
37 42
 ; -------------
38 43
 ; Some constants
@@ -44,7 +49,7 @@ RequestExecutionLevel admin
44 49
 ; Generate zillions of pages to look professional
45 50
 
46 51
   !insertmacro MUI_PAGE_WELCOME
47  
-  ;!insertmacro MUI_PAGE_STARTMENU 
  52
+  !insertmacro MUI_PAGE_STARTMENU Application $STARTMENUFOLDER
48 53
   !insertmacro MUI_PAGE_LICENSE ${ROOT_DIR}\License.txt
49 54
   !insertmacro MUI_PAGE_COMPONENTS
50 55
   !insertmacro MUI_PAGE_DIRECTORY
@@ -76,6 +81,7 @@ Section "OCaml" SecOCaml
76 81
   SetOutPath "$INSTDIR"
77 82
 
78 83
   File ocaml-icon.ico
  84
+  File onlinedoc.url
79 85
   File ${ROOT_DIR}\Changes.txt
80 86
   File ${ROOT_DIR}\License.txt
81 87
   File ${ROOT_DIR}\OCamlWin.exe
@@ -99,6 +105,13 @@ Section "OCaml" SecOCaml
99 105
   WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\OCaml" "DisplayVersion" "${MUI_VERSION}"
100 106
   WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\OCaml" "Publisher" "Inria"
101 107
 
  108
+  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
  109
+    CreateDirectory "$SMPROGRAMS\$STARTMENUFOLDER"
  110
+    CreateShortCut "$SMPROGRAMS\$STARTMENUFOLDER\OCamlWin.lnk" "$INSTDIR\OCamlWin.exe"
  111
+    CreateShortCut "$SMPROGRAMS\$STARTMENUFOLDER\OCamlBrowser.lnk" "$INSTDIR\bin\ocamlbrowser.exe"
  112
+    CreateShortCut "$SMPROGRAMS\$STARTMENUFOLDER\Online Documentation.lnk" "$INSTDIR\onlinedoc.url"
  113
+  !insertmacro MUI_STARTMENU_WRITE_END
  114
+
102 115
   WriteUninstaller $INSTDIR\uninstall.exe
103 116
 
104 117
   end:
@@ -128,21 +141,13 @@ Section "Emacs ${EMACS_VER}" SecEmacs
128 141
   ${EndIf}
129 142
 
130 143
   NSISdl::download ${EMACS_URL} "$TEMP\emacs.zip"
131  
-  nsisunz::UnzipToStack "$TEMP\emacs.zip" "$INSTDIR"
  144
+  nsisunz::UnzipToLog "$TEMP\emacs.zip" "$INSTDIR"
132 145
 
133 146
   Pop $0
134 147
   StrCmp $0 "success" ok
135 148
     DetailPrint "$0"
136  
-    Goto skiplist
137 149
   ok:
138 150
 
139  
-  next:
140  
-    Pop $0
141  
-    DetailPrint $0
142  
-  StrCmp $0 "" 0 next
143  
-
144  
-  skiplist:
145  
-
146 151
   ; add the caml-mode in the emacs distribution
147 152
 
148 153
   SetOutPath "$INSTDIR\emacs-${EMACS_VER}\site-lisp\caml-mode"
@@ -168,6 +173,10 @@ Section "Emacs ${EMACS_VER}" SecEmacs
168 173
 
169 174
   System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
170 175
 
  176
+  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
  177
+    CreateShortCut "$SMPROGRAMS\$STARTMENUFOLDER\Emacs.lnk" "$INSTDIR\emacs-${EMACS_VER}\bin\runemacs.exe"
  178
+  !insertmacro MUI_STARTMENU_WRITE_END
  179
+
171 180
   end:
172 181
 
173 182
 SectionEnd
@@ -218,6 +227,7 @@ Section "Uninstall"
218 227
   RMDir "$INSTDIR\bin"
219 228
 
220 229
   Delete "$INSTDIR\ocaml-icon.ico"
  230
+  Delete "$INSTDIR\onlinedoc.url"
221 231
   Delete "$INSTDIR\Changes.txt"
222 232
   Delete "$INSTDIR\License.txt"
223 233
   Delete "$INSTDIR\OCamlWin.exe"
@@ -226,6 +236,13 @@ Section "Uninstall"
226 236
   !include uninstall_lines.nsi
227 237
   RMDir "$INSTDIR"
228 238
 
  239
+  !insertmacro MUI_STARTMENU_GETFOLDER Application $STARTMENUFOLDER
  240
+  Delete "$SMPROGRAMS\$STARTMENUFOLDER\OCamlWin.lnk"
  241
+  Delete "$SMPROGRAMS\$STARTMENUFOLDER\OCamlBrowser.lnk"
  242
+  Delete "$SMPROGRAMS\$STARTMENUFOLDER\Emacs.lnk"
  243
+  Delete "$SMPROGRAMS\$STARTMENUFOLDER\Online Documentation.lnk"
  244
+  RMDir "$SMPROGRAMS\$STARTMENUFOLDER"
  245
+
229 246
   ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR\bin"
230 247
   ; Using EnvVarUpdate makes sure we do *not* alter OCAMLLIB in case it has
231 248
   ; changed in the meanwhile.
5  onlinedoc.url
... ...
@@ -0,0 +1,5 @@
  1
+[{000214A0-0000-0000-C000-000000000046}]
  2
+Prop3=19,2
  3
+[InternetShortcut]
  4
+URL=http://caml.inria.fr/pub/docs/manual-ocaml/index.html
  5
+IDList=

0 notes on commit 79123f1

Please sign in to comment.
Something went wrong with that request. Please try again.