| 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)]] |