1 |
jpye |
1570 |
Var DAI_RET |
2 |
|
|
Var DAI_TMPFILE |
3 |
|
|
|
4 |
|
|
!macro downloadAndInstall DAI_NAME DAI_URL DAI_FN DAI_CMD |
5 |
|
|
|
6 |
jpye |
1571 |
;MessageBox MB_OK "Downloading ${DAI_NAME}..." |
7 |
jpye |
1570 |
|
8 |
|
|
StrCpy $DAI_TMPFILE "$TEMP\${DAI_FN}" |
9 |
|
|
nsisdl::download /TIMEOUT=30000 ${DAI_URL} $DAI_TMPFILE |
10 |
|
|
Pop $DAI_RET ;Get the return value |
11 |
|
|
${If} $DAI_RET == "success" |
12 |
jpye |
1571 |
;MessageBox MB_OK "Installing ${DAI_NAME}..." |
13 |
|
|
DetailPrint "Installing ${DAI_NAME} (${DAI_FN})" |
14 |
jpye |
1570 |
ExecWait "${DAI_CMD}" $0 |
15 |
jpye |
1571 |
DetailPrint "Return code: $0" |
16 |
|
|
${If} $0 != "0" |
17 |
|
|
MessageBox MB_OK "${DAI_NAME} installer returned $0" |
18 |
|
|
${EndIf} |
19 |
jpye |
1570 |
Delete $DAI_TMPFILE |
20 |
|
|
Push $0 |
21 |
|
|
${ElseIf} $DAI_RET == "cancel" |
22 |
jpye |
1571 |
MessageBox MB_OK "${DAI_NAME} download cancelled." |
23 |
jpye |
1570 |
Push 2 |
24 |
|
|
${Else} |
25 |
|
|
MessageBox MB_OK "Download failed: $DAI_RET" |
26 |
|
|
Push 1 |
27 |
|
|
${EndIf} |
28 |
|
|
|
29 |
|
|
!macroend |