2012年5月29日 星期二

如何利用 7-zip 設定自動解壓縮並解壓縮後自動啟動程式

如何利用 7-zip 設定自動解壓縮並解壓縮後自動啟動程式

1. 先到 7-zip 下載頁 下載 7z Library, SFXs for installers, Plugin for FAR Manager 回來
2. 接著,你只要解壓縮 7zr.exe 7zSD.sfx 兩個檔案就可以了。其中的 Installer 目錄包含使用範例.
3. 然後新增一個文字檔 config.txt ,這是設定 SFX for installers 在執行的時候的行為,包括解壓縮時要顯示什麼標題(Title)、是否要提示使用者按下確認後進行解壓縮(BeginPrompt)、或解壓縮後要自動執行哪支程式(RunProgram)...等等。以下是設定檔範例(備註:檔案請使用 UTF-8 編碼存檔)

;!@Install@!UTF-8!

 

Title="多奇資料庫管理系統"

BeginPrompt="您要執行 多奇資料庫管理系統 嗎?"

RunProgram="Debug\多奇資料庫管理系統.exe"

 

;!@InstallEnd@!

4. 再來,就可以先透過 7zr.exe 程式將檔案壓縮成 7z 檔。

7zr.exe a Debug.7z Debug\

5. 最後一個步驟,就是將 7zSD.sfxconfig.txt、以及 Debug.7z 三個檔案合併成一個可執行檔,我們可以利用 Windows 內建的 copy 指令搭配 /B 參數完成這三個檔案的合併動作。如下指令中,最後一個參數是最後要輸出的執行檔名稱。

copy /b 7zSD.sfx + config.txt + Debug.7z Debug.exe



 

2012年5月7日 星期一

Nuvoton Flash Update Tool Version 4.1.2

Nuvoton Flash Update Tool Version 4.1.2

----------------------------------------

 

Copyright (C) 2009 Nuvoton Technology Corporation. All Rights Reserved.

 

Usage: flupdate [options] <binary file>

       

<binary file>

     A file containing the data to program into flash, in binary format

        

Options:

     -h                 Show program usage

     -v                 Verbose operation - create a log file and also report explicit error messages                        

     -shf               The system uses shared flash (i.e., BIOS and EC FW are located on the same flash device).

     -nshf              The system does not use shared flash (i.e., only FW is on the EC flash).

                        Note that by default (i.e., -shf or -nshf are not

                        selected), the flash layout (i.e., whether the system

                        uses shared flash or not) is detected automatically.

     -c <file name>     Flash Configuration file name. By default, the tool  looks for a configuration file named flupdate.cfg

     -x <exit type>     Select termination option:

                        0 = Normal Exit

                        1 = Reset EC                                     

                        2 = Goto Boot Block (default)         

     -d <file name>     Dump the flash data to the <file name> file before downloading/comparing the <binary file> data

     -compare           Compare the given binary file with the flash data.

                        In this mode, flash is not programmed. If this flag is provided in addition to the -ofs flag (see below), only the bytes starting from <offset> are compared

     -bbl               Ignore protected sectors

     -noverify          Do not verify flash contents after programming

     -nocomp            Program the flash without first comparing its contents to the binary file data.

                        (By default, the contents of each section are compared to the source file, and the section is programmed only if it is different)

     -noreboot          Do not ask the user to restart the computer after download finished                     

     -nopause           Start the download/compare without the user approval.

                        In addition, the application terminates automatically after downloading the binary file to the  flash (without restart the computer)

     -dislusb           For DOS only: disable the Legacy USB SMI (only in Intel  chipsets) during the flash update process

     -cba <address>     Set the Configuration Base Address of the device (in   hex format); otherwise, try to locate the device at the  following addresses (in this order): 0x164E, 0x2E, 0x4E

     -novr              Ignore BIOS model and version check

     -vrd               Verify the flash contents after programming using read command

     -rfp               Remove Flash Protection when the protection window registers are accessible (i.e., not locked)

     -ofs <offset>      Load the provided binary file to the flash starting at offset <offset> from flash start. <offset> must be

                        aligned with the start address of a flash sector. If  this flag is provided in addition to the -compare flag,only the bytes starting from <offset> are compared

     -pfu               Enable FW to perform operations before the Flash   Update process starts (Pre Flash Update)

     -ocv               Override Calibration Values in the flash with the  values provided in the binary file  

     -genbsf <TSF name> Generate a Binary Script File (BSF) from a Text Script   File (TSF). The BSF name is the same as the TSF, but  with a different extension (*.bsf).

     -runbsf <BSF name> Run the commands in the Binary Script FIle (BSF)

                        during the Flash Update process

     -vm <value>        For DOS only. This flag is used to change the default   value of the video mode. It should be used only if  there is a known graphic limitation in the system.

                        Supported values are 18 (the default mode, uses 16   colors), 17 (uses 2 colors) and 0 (text mode)

     -s                 Silent mode (Windows only). This flag eliminates  any user interaction and minimizes the visual effects

     -bec               Binary Exit Code. The default exit code upon failure is a non-zero value. This flag limits the non-zero  value to 1. Thus, the exit code is binary (0 for  success, 1 for failure).

 

==========================

Sincerely,
Charles Chang
張基財

American Megatrends Taiwan Branch

MegaRAC BU Sales Dept. MSG-Engineer

11F, No. 2 Sec. 3 MinChuan E. Road
Taipei 104, Taiwan, R.O.C.

+886-2-2516-8887 #6903