| 48 | {{{ |
| 49 | ~$ cat > NSISdl.nsi << EOF |
| 50 | Name "NSISdl Plugin Test" |
| 51 | OutFile "NSISdl.exe" |
| 52 | |
| 53 | ShowInstDetails show |
| 54 | |
| 55 | Section "Download Hadoop" |
| 56 | NSISdl::download /TIMEOUT=30000 http://ftp.twaren.net/Unix/Web/apache//hadoop/core/hadoop-0.20.2/hadoop-0.20.2.tar.gz hadoop-0.20.2.tar.gz |
| 57 | Pop $0 |
| 58 | StrCmp $0 "success" +3 |
| 59 | MessageBox MB_OK "Download failed: $0" |
| 60 | Quit |
| 61 | SectionEnd |
| 62 | EOF |
| 63 | ~$ makensis NSISdl.nsi |
| 64 | }}} |
| 65 | * 產生出來的 NSISdl.exe 在 Windows 7 上執行的結果如下圖: |
| 66 | * [[Image(10-12-21_NSISdl_complete.png)]] |
| 67 | * [[Image(10-12-21_NSISdl_result.png)]] |