[Groonga-commit] groonga/groonga [master] [windows][installer] add a command prompt for groonga.

Back to archive index

null+****@clear***** null+****@clear*****
2011年 8月 6日 (土) 19:07:21 JST


Kouhei Sutou	2011-08-06 10:07:21 +0000 (Sat, 06 Aug 2011)

  New Revision: 3af5ca36683ef52d2ff1c010caae8787f75abd5a

  Log:
    [windows][installer] add a command prompt for groonga.

  Added files:
    packages/windows/create-setup.bat
  Modified files:
    packages/windows/setup.nsi.in

  Added: packages/windows/create-setup.bat (+2 -0) 100644
===================================================================
--- /dev/null
+++ packages/windows/create-setup.bat    2011-08-06 10:07:21 +0000 (1496f75)
@@ -0,0 +1,2 @@
+echo @echo off > %1\setup.bat
+echo set PATH=%1;%%PATH%% >> %1\setup.bat

  Modified: packages/windows/setup.nsi.in (+24 -17)
===================================================================
--- packages/windows/setup.nsi.in    2011-08-06 07:14:37 +0000 (dfeeb94)
+++ packages/windows/setup.nsi.in    2011-08-06 10:07:21 +0000 (742799c)
@@ -19,24 +19,29 @@ SetCompressor lzma
 !define MUI_LANGDLL_ALLLANGUAGES
 !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
+
 !insertmacro MUI_PAGE_WELCOME
 !define MUI_LICENSEPAGE_CHECKBOX
 !insertmacro MUI_PAGE_LICENSE "LICENSE"
 !insertmacro MUI_PAGE_COMPONENTS
 !insertmacro MUI_PAGE_DIRECTORY
-var ICONS_GROUP
+Var START_MENU_FOLDER
 !define MUI_STARTMENUPAGE_NODISABLE
 !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${PRODUCT_NAME}"
 !define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
 !define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
-!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
+!insertmacro MUI_PAGE_STARTMENU Application $START_MENU_FOLDER
 !insertmacro MUI_PAGE_INSTFILES
 ; !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\doc\README.txt"
 !insertmacro MUI_PAGE_FINISH
+
+!insertmacro MUI_UNPAGE_WELCOME
+!insertmacro MUI_UNPAGE_CONFIRM
 !insertmacro MUI_UNPAGE_INSTFILES
+!insertmacro MUI_UNPAGE_FINISH
 
-!insertmacro MUI_LANGUAGE "English" ; first language is the default language
+!insertmacro MUI_LANGUAGE "English"
 !insertmacro MUI_LANGUAGE "Japanese"
 !insertmacro MUI_RESERVEFILE_LANGDLL
 
@@ -63,23 +68,26 @@ Section "groonga"
 
   SetOutPath $INSTDIR
   File /r dist\*
-SectionEnd
+  File /oname=bin\create-setup.bat create-setup.bat
+
+  ExecWait '"$INSTDIR\bin\create-setup.bat" "$INSTDIR\bin"'
 
-Section -AdditionalIcons
-  SetOutPath $INSTDIR
   !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
-  CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
-  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" $INSTDIR\uninstall_${PRODUCT_NAME}.exe
+  SetShellVarContext all
+  CreateDirectory "$SMPROGRAMS\$START_MENU_FOLDER"
+  CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\Uninstall.lnk" $INSTDIR\uninstall.exe
+  CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\groonga command prompt.lnk" "$SYSDIR\cmd.exe" '/E:ON /K ""$INSTDIR\bin\setup.bat""'
   !insertmacro MUI_STARTMENU_WRITE_END
 SectionEnd
 
 Section -Post
-  WriteUninstaller $INSTDIR\uninstall_${PRODUCT_NAME}.exe
+  WriteUninstaller $INSTDIR\uninstall.exe
   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
-  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" $INSTDIR\uninstall_${PRODUCT_NAME}.exe
+  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" $INSTDIR\uninstall.exe
   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
+  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "StartMenuFolder" "$START_MENU_FOLDER"
 SectionEnd
 
 # Uninstaller
@@ -94,12 +102,11 @@ Function un.onInit
 FunctionEnd
 
 Section "Uninstall"
-  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 $(ConfirmUninstall) IDYES +2
-  Abort
-
-  !insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
+  ReadRegStr $START_MENU_FOLDER ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "StartMenuFolder"
+  DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
 
   RMDir /r $INSTDIR
-  DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
-  SetAutoClose true
-FunctionEnd
+
+  SetShellVarContext all
+  RMDir /r "$SMPROGRAMS\$START_MENU_FOLDER"
+SectionEnd




Groonga-commit メーリングリストの案内
Back to archive index