Indentation and clause order refinements on NSIS installer

This commit is contained in:
Michael Martin
2020-06-08 00:05:51 -07:00
parent a7121e9d85
commit b77ed37796
+14 -13
View File
@@ -179,19 +179,8 @@ AttemptDownload:
CreateDirectory $DOWNLOADTARGET CreateDirectory $DOWNLOADTARGET
inetc::get "https://downloads.sourceforge.net/project/sc2/$DOWNLOADPATH$1" "$DOWNLOADTARGET/$1" /END inetc::get "https://downloads.sourceforge.net/project/sc2/$DOWNLOADPATH$1" "$DOWNLOADTARGET/$1" /END
Pop $2 Pop $2
${If} $2 != "OK" ${If} $2 == "OK"
${If} $2 == "Cancelled" # Download completed. Confirm the MD5 sum is OK.
StrCpy $2 "Download was canceled by user."
${Else}
StrCpy $2 "Could not install the package $1 due to the following error: $\"$2$\"."
${EndIf}
${If} $MANDATORY != 0
StrCpy $3 "THIS IS A MANDATORY PACKAGE. Without this package, $(^Name) will NOT run."
${Else}
StrCpy $3 "This is an optional package. $(^Name) will still run, but some content will not be available."
${EndIf}
MessageBox MB_ICONEXCLAMATION|MB_YESNO "$2 $3 Do you want to retry from a different mirror?" IDYES AttemptDownload
${Else}
md5dll::GetFileMD5 "$DOWNLOADTARGET\$1" md5dll::GetFileMD5 "$DOWNLOADTARGET\$1"
Pop $3 Pop $3
${If} $MD5SUM != $3 ${If} $MD5SUM != $3
@@ -203,6 +192,18 @@ AttemptDownload:
MessageBox MB_ICONEXCLAMATION|MB_YESNO "The downloaded file $1 doesn't match the internal MD5 sum. This probably means the download was corrupt. $3 Do you want to retry from a different mirror? (Select NO to install the downloaded package anyway - for instance, if you know that the content pack was upgraded or modified since.)" IDYES AttemptDownload MessageBox MB_ICONEXCLAMATION|MB_YESNO "The downloaded file $1 doesn't match the internal MD5 sum. This probably means the download was corrupt. $3 Do you want to retry from a different mirror? (Select NO to install the downloaded package anyway - for instance, if you know that the content pack was upgraded or modified since.)" IDYES AttemptDownload
${EndIf} ${EndIf}
CopyFiles "$DOWNLOADTARGET\$1" "$0\$1" CopyFiles "$DOWNLOADTARGET\$1" "$0\$1"
${Else}
${If} $2 == "Cancelled"
StrCpy $2 "Download was canceled by user."
${Else}
StrCpy $2 "Could not install the package $1 due to the following error: $\"$2$\"."
${EndIf}
${If} $MANDATORY != 0
StrCpy $3 "THIS IS A MANDATORY PACKAGE. Without this package, $(^Name) will NOT run."
${Else}
StrCpy $3 "This is an optional package. $(^Name) will still run, but some content will not be available."
${EndIf}
MessageBox MB_ICONEXCLAMATION|MB_YESNO "$2 $3 Do you want to retry from a different mirror?" IDYES AttemptDownload
${EndIf} ${EndIf}
RmDir /r $DOWNLOADTARGET RmDir /r $DOWNLOADTARGET
PackageDone: PackageDone: