Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Commit

Permalink
Add start menu entries.
Browse files Browse the repository at this point in the history
  • Loading branch information
protz committed Sep 13, 2011
1 parent 49d9576 commit 79123f1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
37 changes: 27 additions & 10 deletions install.nsi
Expand Up @@ -33,6 +33,11 @@ RequestExecutionLevel admin
!define MUI_FINISHPAGE_TITLE "Congratulations! You have installed OCaml" !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_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_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 ; Some constants
Expand All @@ -44,7 +49,7 @@ RequestExecutionLevel admin
; Generate zillions of pages to look professional ; Generate zillions of pages to look professional


!insertmacro MUI_PAGE_WELCOME !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_LICENSE ${ROOT_DIR}\License.txt
!insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_DIRECTORY
Expand Down Expand Up @@ -76,6 +81,7 @@ Section "OCaml" SecOCaml
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"


File ocaml-icon.ico File ocaml-icon.ico
File onlinedoc.url
File ${ROOT_DIR}\Changes.txt File ${ROOT_DIR}\Changes.txt
File ${ROOT_DIR}\License.txt File ${ROOT_DIR}\License.txt
File ${ROOT_DIR}\OCamlWin.exe File ${ROOT_DIR}\OCamlWin.exe
Expand All @@ -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" "DisplayVersion" "${MUI_VERSION}"
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\OCaml" "Publisher" "Inria" 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 WriteUninstaller $INSTDIR\uninstall.exe


end: end:
Expand Down Expand Up @@ -128,21 +141,13 @@ Section "Emacs ${EMACS_VER}" SecEmacs
${EndIf} ${EndIf}


NSISdl::download ${EMACS_URL} "$TEMP\emacs.zip" NSISdl::download ${EMACS_URL} "$TEMP\emacs.zip"
nsisunz::UnzipToStack "$TEMP\emacs.zip" "$INSTDIR" nsisunz::UnzipToLog "$TEMP\emacs.zip" "$INSTDIR"


Pop $0 Pop $0
StrCmp $0 "success" ok StrCmp $0 "success" ok
DetailPrint "$0" DetailPrint "$0"
Goto skiplist
ok: ok:


next:
Pop $0
DetailPrint $0
StrCmp $0 "" 0 next

skiplist:

; add the caml-mode in the emacs distribution ; add the caml-mode in the emacs distribution


SetOutPath "$INSTDIR\emacs-${EMACS_VER}\site-lisp\caml-mode" SetOutPath "$INSTDIR\emacs-${EMACS_VER}\site-lisp\caml-mode"
Expand All @@ -168,6 +173,10 @@ Section "Emacs ${EMACS_VER}" SecEmacs


System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)' 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: end:


SectionEnd SectionEnd
Expand Down Expand Up @@ -218,6 +227,7 @@ Section "Uninstall"
RMDir "$INSTDIR\bin" RMDir "$INSTDIR\bin"


Delete "$INSTDIR\ocaml-icon.ico" Delete "$INSTDIR\ocaml-icon.ico"
Delete "$INSTDIR\onlinedoc.url"
Delete "$INSTDIR\Changes.txt" Delete "$INSTDIR\Changes.txt"
Delete "$INSTDIR\License.txt" Delete "$INSTDIR\License.txt"
Delete "$INSTDIR\OCamlWin.exe" Delete "$INSTDIR\OCamlWin.exe"
Expand All @@ -226,6 +236,13 @@ Section "Uninstall"
!include uninstall_lines.nsi !include uninstall_lines.nsi
RMDir "$INSTDIR" 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" ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR\bin"
; Using EnvVarUpdate makes sure we do *not* alter OCAMLLIB in case it has ; Using EnvVarUpdate makes sure we do *not* alter OCAMLLIB in case it has
; changed in the meanwhile. ; changed in the meanwhile.
Expand Down
5 changes: 5 additions & 0 deletions onlinedoc.url
@@ -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.