Cancelling a download now cancels install, install cleans up if it fails.
This commit is contained in:
@@ -93,6 +93,9 @@ SectionGroup /e "Mods"
|
|||||||
AddSize 10137
|
AddSize 10137
|
||||||
SetOutPath "$OUTDIR\packages"
|
SetOutPath "$OUTDIR\packages"
|
||||||
NSISdl::download http://open-ra.org/packages/ra-packages.zip ra-packages.zip
|
NSISdl::download http://open-ra.org/packages/ra-packages.zip ra-packages.zip
|
||||||
|
Pop $R0
|
||||||
|
StrCmp $R0 "success" +2
|
||||||
|
Abort
|
||||||
ZipDLL::extractall "ra-packages.zip" "$OUTDIR"
|
ZipDLL::extractall "ra-packages.zip" "$OUTDIR"
|
||||||
Delete ra-packages.zip
|
Delete ra-packages.zip
|
||||||
done:
|
done:
|
||||||
@@ -110,6 +113,9 @@ SectionGroup /e "Mods"
|
|||||||
AddSize 9431
|
AddSize 9431
|
||||||
SetOutPath "$OUTDIR\packages"
|
SetOutPath "$OUTDIR\packages"
|
||||||
NSISdl::download http://open-ra.org/packages/cnc-packages.zip cnc-packages.zip
|
NSISdl::download http://open-ra.org/packages/cnc-packages.zip cnc-packages.zip
|
||||||
|
Pop $R0
|
||||||
|
StrCmp $R0 "success" +2
|
||||||
|
Abort
|
||||||
ZipDLL::extractall "cnc-packages.zip" "$OUTDIR"
|
ZipDLL::extractall "cnc-packages.zip" "$OUTDIR"
|
||||||
Delete cnc-packages.zip
|
Delete cnc-packages.zip
|
||||||
done:
|
done:
|
||||||
@@ -133,6 +139,9 @@ Section "-OpenAl" OpenAl
|
|||||||
installal:
|
installal:
|
||||||
SetOutPath "$TEMP"
|
SetOutPath "$TEMP"
|
||||||
NSISdl::download http://connect.creativelabs.com/openal/Downloads/oalinst.zip oalinst.zip
|
NSISdl::download http://connect.creativelabs.com/openal/Downloads/oalinst.zip oalinst.zip
|
||||||
|
Pop $R0
|
||||||
|
StrCmp $R0 "success" +2
|
||||||
|
Abort
|
||||||
!insertmacro ZIPDLL_EXTRACT oalinst.zip OpenAL oalinst.exe
|
!insertmacro ZIPDLL_EXTRACT oalinst.zip OpenAL oalinst.exe
|
||||||
ExecWait "$TEMP\OpenAL\oalinst.exe"
|
ExecWait "$TEMP\OpenAL\oalinst.exe"
|
||||||
done:
|
done:
|
||||||
@@ -149,9 +158,15 @@ Section "-Freetype" Freetype
|
|||||||
AddSize 583
|
AddSize 583
|
||||||
SetOutPath "$TEMP"
|
SetOutPath "$TEMP"
|
||||||
NSISdl::download http://downloads.sourceforge.net/project/gnuwin32/freetype/2.3.5-1/freetype-2.3.5-1-bin.zip freetype.zip
|
NSISdl::download http://downloads.sourceforge.net/project/gnuwin32/freetype/2.3.5-1/freetype-2.3.5-1-bin.zip freetype.zip
|
||||||
|
Pop $R0
|
||||||
|
StrCmp $R0 "success" +2
|
||||||
|
Abort
|
||||||
!insertmacro ZIPDLL_EXTRACT freetype.zip $OUTDIR bin\freetype6.dll
|
!insertmacro ZIPDLL_EXTRACT freetype.zip $OUTDIR bin\freetype6.dll
|
||||||
CopyFiles "$OUTDIR\bin\freetype6.dll" $INSTDIR
|
CopyFiles "$OUTDIR\bin\freetype6.dll" $INSTDIR
|
||||||
NSISdl::download http://www.zlib.net/zlib123-dll.zip zlib.zip
|
NSISdl::download http://www.zlib.net/zlib123-dll.zip zlib.zip
|
||||||
|
Pop $R0
|
||||||
|
StrCmp $R0 "success" +2
|
||||||
|
Abort
|
||||||
!insertmacro ZIPDLL_EXTRACT zlib.zip $OUTDIR zlib1.dll
|
!insertmacro ZIPDLL_EXTRACT zlib.zip $OUTDIR zlib1.dll
|
||||||
CopyFiles "$OUTDIR\zlib1.dll" $INSTDIR
|
CopyFiles "$OUTDIR\zlib1.dll" $INSTDIR
|
||||||
SectionEnd
|
SectionEnd
|
||||||
@@ -176,7 +191,8 @@ Section "-Uninstaller"
|
|||||||
!insertmacro MUI_STARTMENU_WRITE_END
|
!insertmacro MUI_STARTMENU_WRITE_END
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section "Uninstall"
|
!macro Clean UN
|
||||||
|
Function ${UN}Clean
|
||||||
RMDir /r $INSTDIR\mods
|
RMDir /r $INSTDIR\mods
|
||||||
RMDir /r $INSTDIR\shaders
|
RMDir /r $INSTDIR\shaders
|
||||||
Delete $INSTDIR\OpenRA.Game.exe
|
Delete $INSTDIR\OpenRA.Game.exe
|
||||||
@@ -201,6 +217,14 @@ Section "Uninstall"
|
|||||||
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
|
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
|
||||||
RMDir /r "$SMPROGRAMS\$StartMenuFolder"
|
RMDir /r "$SMPROGRAMS\$StartMenuFolder"
|
||||||
DeleteRegKey HKCU "Software\OpenRA"
|
DeleteRegKey HKCU "Software\OpenRA"
|
||||||
|
FunctionEnd
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
!insertmacro Clean ""
|
||||||
|
!insertmacro Clean "un."
|
||||||
|
|
||||||
|
Section "Uninstall"
|
||||||
|
Call un.Clean
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
;***************************
|
;***************************
|
||||||
@@ -221,7 +245,7 @@ LangString DESC_RA_NG ${LANG_ENGLISH} "Next-gen Red Alert mod (depends on base R
|
|||||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||||
|
|
||||||
;***************************
|
;***************************
|
||||||
;Functions
|
;Callbacks
|
||||||
;***************************
|
;***************************
|
||||||
Var previousSelection
|
Var previousSelection
|
||||||
|
|
||||||
@@ -250,3 +274,7 @@ Function .onSelChange
|
|||||||
done:
|
done:
|
||||||
IntOp $previousSelection $1 + 0
|
IntOp $previousSelection $1 + 0
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
Function .onInstFailed
|
||||||
|
Call Clean
|
||||||
|
FunctionEnd
|
||||||
|
|||||||
Reference in New Issue
Block a user