Permalink
Browse files

Add start menu entries.

  • Loading branch information...
1 parent 49d9576 commit 79123f1e78c022d8de4d7b4432c3cfebd9bb610a @protz committed Sep 13, 2011
Showing with 32 additions and 10 deletions.
  1. +27 −10 install.nsi
  2. +5 −0 onlinedoc.url
View
@@ -33,6 +33,11 @@ RequestExecutionLevel admin
!define MUI_FINISHPAGE_TITLE "Congratulations! You have installed OCaml"
!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!"
!define MUI_WELCOMEFINISHPAGE_BITMAP "side.bmp"
+!define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX"
+!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\OCaml"
+!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
+
+Var STARTMENUFOLDER
; -------------
; Some constants
@@ -44,7 +49,7 @@ RequestExecutionLevel admin
; Generate zillions of pages to look professional
!insertmacro MUI_PAGE_WELCOME
- ;!insertmacro MUI_PAGE_STARTMENU
+ !insertmacro MUI_PAGE_STARTMENU Application $STARTMENUFOLDER
!insertmacro MUI_PAGE_LICENSE ${ROOT_DIR}\License.txt
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
@@ -76,6 +81,7 @@ Section "OCaml" SecOCaml
SetOutPath "$INSTDIR"
File ocaml-icon.ico
+ File onlinedoc.url
File ${ROOT_DIR}\Changes.txt
File ${ROOT_DIR}\License.txt
File ${ROOT_DIR}\OCamlWin.exe
@@ -99,6 +105,13 @@ Section "OCaml" SecOCaml
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\OCaml" "DisplayVersion" "${MUI_VERSION}"
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\OCaml" "Publisher" "Inria"
+ !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
+ CreateDirectory "$SMPROGRAMS\$STARTMENUFOLDER"
+ CreateShortCut "$SMPROGRAMS\$STARTMENUFOLDER\OCamlWin.lnk" "$INSTDIR\OCamlWin.exe"
+ CreateShortCut "$SMPROGRAMS\$STARTMENUFOLDER\OCamlBrowser.lnk" "$INSTDIR\bin\ocamlbrowser.exe"
+ CreateShortCut "$SMPROGRAMS\$STARTMENUFOLDER\Online Documentation.lnk" "$INSTDIR\onlinedoc.url"
+ !insertmacro MUI_STARTMENU_WRITE_END
+
WriteUninstaller $INSTDIR\uninstall.exe
end:
@@ -128,21 +141,13 @@ Section "Emacs ${EMACS_VER}" SecEmacs
${EndIf}
NSISdl::download ${EMACS_URL} "$TEMP\emacs.zip"
- nsisunz::UnzipToStack "$TEMP\emacs.zip" "$INSTDIR"
+ nsisunz::UnzipToLog "$TEMP\emacs.zip" "$INSTDIR"
Pop $0
StrCmp $0 "success" ok
DetailPrint "$0"
- Goto skiplist
ok:
- next:
- Pop $0
- DetailPrint $0
- StrCmp $0 "" 0 next
-
- skiplist:
-
; add the caml-mode in the emacs distribution
SetOutPath "$INSTDIR\emacs-${EMACS_VER}\site-lisp\caml-mode"
@@ -168,6 +173,10 @@ Section "Emacs ${EMACS_VER}" SecEmacs
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
+ !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
+ CreateShortCut "$SMPROGRAMS\$STARTMENUFOLDER\Emacs.lnk" "$INSTDIR\emacs-${EMACS_VER}\bin\runemacs.exe"
+ !insertmacro MUI_STARTMENU_WRITE_END
+
end:
SectionEnd
@@ -218,6 +227,7 @@ Section "Uninstall"
RMDir "$INSTDIR\bin"
Delete "$INSTDIR\ocaml-icon.ico"
+ Delete "$INSTDIR\onlinedoc.url"
Delete "$INSTDIR\Changes.txt"
Delete "$INSTDIR\License.txt"
Delete "$INSTDIR\OCamlWin.exe"
@@ -226,6 +236,13 @@ Section "Uninstall"
!include uninstall_lines.nsi
RMDir "$INSTDIR"
+ !insertmacro MUI_STARTMENU_GETFOLDER Application $STARTMENUFOLDER
+ Delete "$SMPROGRAMS\$STARTMENUFOLDER\OCamlWin.lnk"
+ Delete "$SMPROGRAMS\$STARTMENUFOLDER\OCamlBrowser.lnk"
+ Delete "$SMPROGRAMS\$STARTMENUFOLDER\Emacs.lnk"
+ Delete "$SMPROGRAMS\$STARTMENUFOLDER\Online Documentation.lnk"
+ RMDir "$SMPROGRAMS\$STARTMENUFOLDER"
+
${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR\bin"
; Using EnvVarUpdate makes sure we do *not* alter OCAMLLIB in case it has
; changed in the meanwhile.
View
@@ -0,0 +1,5 @@
+[{000214A0-0000-0000-C000-000000000046}]
+Prop3=19,2
+[InternetShortcut]
+URL=http://caml.inria.fr/pub/docs/manual-ocaml/index.html
+IDList=

0 comments on commit 79123f1

Please sign in to comment.