close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": libsvn_repos-1.so.1: failed to map segment from shared object: Cannot allocate memory). Look in the Trac log for more information.
- Timestamp:
-
Dec 22, 2010, 12:09:42 AM (15 years ago)
- Author:
-
jazz
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
|
v14
|
v15
|
|
| 73 | 73 | }}} |
| 74 | 74 | |
| 75 | | * 學習讀取 ini 設定檔 - [參考] /usr/share/doc/nsis/Examples/{FileFunc.nsi.gz, FileFunc.ini} |
| 76 | | * 使用 [http://omega.idv.tw/nsis/Section4.9.html#4.9.2.10 ReadINIStr] 這個語法,以 FileFunc.nsi 為例。 |
| 77 | | * 首先,第一步是找到 INI 檔案的路徑。第 17 行設定 INI 這個變數。 |
| 78 | | * 第 723~727 行,首先 [http://omega.idv.tw/nsis/Section4.7.html#4.7.2.1.2 .onInit] 這個函數 |
| | 75 | * 學習讀取 ini 設定檔 - [參考] /usr/share/doc/nsis/Examples/{!FileFunc.nsi.gz, !FileFunc.ini} |
| | 76 | * 使用 [http://omega.idv.tw/nsis/Section4.9.html#4.9.2.10 ReadINIStr] 這個語法,以 !FileFunc.nsi 為例。 |
| | 77 | * 首先,第一步是找到 INI 檔案的路徑。第 17 行宣告 INI 這個變數。第 723~727 行,設定 INI 這個變數,並且讓它的內容等於編譯時提供的 !FileFunc.ini。 |
| | 78 | * 流程上,透過 [http://omega.idv.tw/nsis/Section4.7.html#4.7.2.1.2 .onInit] 這個函數宣告初始化流程要做的事情就是把 !FileFunc.ini 拷貝到 $PLUGINSDIR 目錄中的暫存檔 $INI。 |
| 79 | 79 | * 用 [http://omega.idv.tw/nsis/Section4.9.html#4.9.7.3 InitPluginsDir] 這個語法設定 $PLUGINSDIR 目錄變數 |
| 80 | 80 | * 用 [http://omega.idv.tw/nsis/Section4.9.html#4.9.3.10 GetTempFileName] 這個語法會在 $PLUGINSDIR 目錄產生一個暫存檔,並回傳檔名存放於 $INI 中。 |
| 81 | | * 用 [http://omega.idv.tw/nsis/Section4.9.html#4.9.1.5 File] 把 FileFunc.ini 拷貝存放到 $INI 的路徑去。 |
| | 81 | * 用 [http://omega.idv.tw/nsis/Section4.9.html#4.9.1.5 File] 把 !FileFunc.ini 拷貝存放到 $INI 的路徑去。 |
| 82 | 82 | {{{ |
| 83 | 83 | GetTempFileName 使用者變數(輸出) [暫存檔路徑] |
| … |
… |
|
| 95 | 95 | 727 FunctionEnd |
| 96 | 96 | }}} |
| | 97 | * 接著,第 19 行宣告 STATE 變數,並於第 96 行使用 [http://omega.idv.tw/nsis/Section4.9.html#4.9.2.10 ReadINIStr] 從 $INI 的 "![Field 1]" 這個區段(section)的某一項(entry) |
| | 98 | {{{ |
| | 99 | ReadINIStr 用戶變量(輸出) INI檔案 區段 項 |
| | 100 | ReadINIStr user_var(output) ini_filename section_name entry_name |
| | 101 | }}} |
| | 102 | * 在 !FileFunc.ini 中就定義了 "[Field 1]" 這一個區段(section),並定義了 State 這一項(entry)。 |
| | 103 | {{{ |
| | 104 | 5 [Field 1] |
| | 105 | 8 State=" 1. Locate" |
| | 106 | }}} |
| 97 | 107 | {{{ |
| 98 | 108 | 19 Var STATE |