Changes between Version 33 and Version 34 of jazz/hadoop4win-dev


Ignore:
Timestamp:
Apr 15, 2011, 2:30:04 AM (14 years ago)
Author:
jazz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • jazz/hadoop4win-dev

    v33 v34  
    5555Total size:                    53165 / 84384 bytes (63.0%)
    5656}}}
     57[[Image(11-04-15_nsExec_Test.jpg)]]
    5758 * 如果要設計網路安裝版,倒也可以用 [http://nsis.sourceforge.net/Builtin_NSISdl_plug-in NSISdl] 這個 plugin 來開發。簡單寫一個測試範例,還算蠻簡單的。(注意:底下用 \$ 是為了配合 cat 語法,若直接貼程式碼請拿掉!)
    5859{{{
     
    203204~$ makensis Basic.nsi
    204205}}}
    205  * 這個範例蠻單純的,就是在使用者的 Local Data 目錄中產生 Modern UI 目錄,裡面放 Uninstall.exe
     206 * 這個範例蠻單純的,就是在指定安裝的目錄中放 Uninstall.exe
     207[[Image(11-04-15_MUI_Basic_1.jpg)]]
     208[[Image(11-04-15_MUI_Basic_2.jpg)]]
     209[[Image(11-04-15_MUI_Basic_3.jpg)]]
     210[[Image(11-04-15_MUI_Basic_4.jpg)]]
    206211 * 接著看 !WelcomeFinish.nsi,跟 Basic.nsi 差別就只有四行:
    207212{{{
     
    215220~$ makensis WelcomeFinish.nsi
    216221}}}
     222[[Image(11-04-15_MUI_Welcome.jpg)]]
     223[[Image(11-04-15_MUI_Finish.jpg)]]
    217224 * 至於 !HeaderBitmap.nsi 主要則增加兩行:
    218225{{{
     
    224231~$ makensis HeaderBitmap.nsi
    225232}}}
     233[[Image(11-04-15_MUI_HeaderBitmap.jpg)]]
     234 * 若要在開始選單產生目錄,StartMenu.nsi 加了幾個語法
     235{{{
     236  Var StartMenuFolder
     237
     238  # 用 Registry 紀錄使用者設定的「開始」選單「目錄名稱」
     239  !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
     240  !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Modern UI Test"
     241  !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
     242
     243  # 顯示要使用 STARTMENU 的頁面
     244  !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
     245
     246 # 把要在「開始」選單中處理的動作,寫在 MUI_STARTMENU_WRITE_BEGIN 跟 MUI_STARTMENU_WRITE_END 頁面中間
     247 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
     248
     249    ;Create shortcuts
     250    CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
     251    CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
     252
     253  !insertmacro MUI_STARTMENU_WRITE_END
     254
     255 # 把要從「開始」選端中反安裝的動作,寫在 MUI_STARTMENU_GETFOLDER 之後。
     256  !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
     257
     258  Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
     259  RMDir "$SMPROGRAMS\$StartMenuFolder"
     260}}}
     261{{{
     262~$ cp /usr/share/doc/nsis/Examples/Modern\ UI/StartMenu.nsi .
     263~$ makensis StartMenu.nsi
     264}}}
     265[[Image(11-04-15_MUI_StartMenu.jpg)]]
     266[[Image(11-04-15_MUI_Uninstall.jpg)]]
     267 * 比較複雜的是 MultiLanguage.nsi
     268{{{
     269}}}
     270[[Image(11-04-15_MUI_MultiLang_1.jpg)]]
     271[[Image(11-04-15_MUI_MultiLang_2.jpg)]]
     272[[Image(11-04-15_MUI_MultiLang_3.jpg)]]
     273[[Image(11-04-15_MUI_MultiLang_4.jpg)]]
     274[[Image(11-04-15_MUI_MultiLang_5.jpg)]]