summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-07-22 19:39:42 +0000
committersr55 <[email protected]>2015-07-22 19:39:42 +0000
commit789942de890112b74e1cd4f29902138a2b8a0ba6 (patch)
tree9b9b872be21829b5b7102556e879cf4d77706436 /win/CS/HandBrakeWPF
parentb1e3d11e361b73a36a11f3f3462c75526fe100f2 (diff)
WinGui: Improve .NET 4.6 detection code in the NSIS installer.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7368 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/Installer/Installer.nsi137
-rw-r--r--win/CS/HandBrakeWPF/Installer/Installer64.nsi137
-rw-r--r--win/CS/HandBrakeWPF/Installer/MakeNightly.nsi.tmpl137
-rw-r--r--win/CS/HandBrakeWPF/Installer/MakeNightly64.nsi.tmpl137
4 files changed, 40 insertions, 508 deletions
diff --git a/win/CS/HandBrakeWPF/Installer/Installer.nsi b/win/CS/HandBrakeWPF/Installer/Installer.nsi
index fb803ba77..7bcc6b741 100644
--- a/win/CS/HandBrakeWPF/Installer/Installer.nsi
+++ b/win/CS/HandBrakeWPF/Installer/Installer.nsi
@@ -199,134 +199,17 @@ SectionEnd
;Check for .NET framework
Function CheckFrameWork
+ ; Magic numbers from http://msdn.microsoft.com/en-us/library/ee942965.aspx
+ ClearErrors
+ ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" "Release"
- ;Save the variables in case something else is using them
- Push $0
- Push $1
- Push $2
- Push $3
- Push $4
- Push $R1
- Push $R2
- Push $R3
- Push $R4
- Push $R5
- Push $R6
- Push $R7
- Push $R8
-
- StrCpy $R5 "0"
- StrCpy $R6 "0"
- StrCpy $R7 "0"
- StrCpy $R8 "0.0.0"
- StrCpy $0 0
-
- loop:
-
- ;Get each sub key under "SOFTWARE\Microsoft\NET Framework Setup\NDP"
- EnumRegKey $1 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP" $0
- StrCmp $1 "" done ;jump to end if no more registry keys
- IntOp $0 $0 + 1
- StrCpy $2 $1 1 ;Cut off the first character
- StrCpy $3 $1 "" 1 ;Remainder of string
-
- ;Loop if first character is not a 'v'
- StrCmpS $2 "v" start_parse loop
-
- ;Parse the string
- start_parse:
- StrCpy $R1 ""
- StrCpy $R2 ""
- StrCpy $R3 ""
- StrCpy $R4 $3
-
- StrCpy $4 1
-
- parse:
- StrCmp $3 "" parse_done ;If string is empty, we are finished
- StrCpy $2 $3 1 ;Cut off the first character
- StrCpy $3 $3 "" 1 ;Remainder of string
- StrCmp $2 "." is_dot not_dot ;Move to next part if it's a dot
-
- is_dot:
- IntOp $4 $4 + 1 ; Move to the next section
- goto parse ;Carry on parsing
-
- not_dot:
- IntCmp $4 1 major_ver
- IntCmp $4 2 minor_ver
- IntCmp $4 3 build_ver
- IntCmp $4 4 parse_done
-
- major_ver:
- StrCpy $R1 $R1$2
- goto parse ;Carry on parsing
-
- minor_ver:
- StrCpy $R2 $R2$2
- goto parse ;Carry on parsing
-
- build_ver:
- StrCpy $R3 $R3$2
- goto parse ;Carry on parsing
-
- parse_done:
-
- IntCmp $R1 $R5 this_major_same loop this_major_more
- this_major_more:
- StrCpy $R5 $R1
- StrCpy $R6 $R2
- StrCpy $R7 $R3
- StrCpy $R8 $R4
-
- goto loop
-
- this_major_same:
- IntCmp $R2 $R6 this_minor_same loop this_minor_more
- this_minor_more:
- StrCpy $R6 $R2
- StrCpy $R7 R3
- StrCpy $R8 $R4
- goto loop
-
- this_minor_same:
- IntCmp $R3 $R7 loop loop this_build_more
- this_build_more:
- StrCpy $R7 $R3
- StrCpy $R8 $R4
- goto loop
+ IfErrors NotDetected
- done:
+ ${If} $0 >= 393295
+ StrCpy $0 "1"
+ ${Else}
+ NotDetected:
+ StrCpy $0 "2"
+ ${EndIf}
- ;Have we got the framework we need?
- IntCmp $R5 ${MIN_FRA_MAJOR} max_major_same fail OK
- max_major_same:
- IntCmp $R6 ${MIN_FRA_MINOR} max_minor_same fail OK
- max_minor_same:
- IntCmp $R7 ${MIN_FRA_BUILD} OK fail OK
-
- ;Version on machine is greater than what we need
- OK:
- StrCpy $0 "1"
- goto end
-
- fail:
- StrCmp $R8 "0.0.0" end
-
-
- end:
-
- ;Pop the variables we pushed earlier
- Pop $R8
- Pop $R7
- Pop $R6
- Pop $R5
- Pop $R4
- Pop $R3
- Pop $R2
- Pop $R1
- Pop $4
- Pop $3
- Pop $2
- Pop $1
FunctionEnd \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Installer/Installer64.nsi b/win/CS/HandBrakeWPF/Installer/Installer64.nsi
index b060a6550..42957f8be 100644
--- a/win/CS/HandBrakeWPF/Installer/Installer64.nsi
+++ b/win/CS/HandBrakeWPF/Installer/Installer64.nsi
@@ -201,134 +201,17 @@ SectionEnd
;Check for .NET framework
Function CheckFrameWork
+ ; Magic numbers from http://msdn.microsoft.com/en-us/library/ee942965.aspx
+ ClearErrors
+ ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" "Release"
- ;Save the variables in case something else is using them
- Push $0
- Push $1
- Push $2
- Push $3
- Push $4
- Push $R1
- Push $R2
- Push $R3
- Push $R4
- Push $R5
- Push $R6
- Push $R7
- Push $R8
-
- StrCpy $R5 "0"
- StrCpy $R6 "0"
- StrCpy $R7 "0"
- StrCpy $R8 "0.0.0"
- StrCpy $0 0
-
- loop:
-
- ;Get each sub key under "SOFTWARE\Microsoft\NET Framework Setup\NDP"
- EnumRegKey $1 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP" $0
- StrCmp $1 "" done ;jump to end if no more registry keys
- IntOp $0 $0 + 1
- StrCpy $2 $1 1 ;Cut off the first character
- StrCpy $3 $1 "" 1 ;Remainder of string
-
- ;Loop if first character is not a 'v'
- StrCmpS $2 "v" start_parse loop
-
- ;Parse the string
- start_parse:
- StrCpy $R1 ""
- StrCpy $R2 ""
- StrCpy $R3 ""
- StrCpy $R4 $3
-
- StrCpy $4 1
-
- parse:
- StrCmp $3 "" parse_done ;If string is empty, we are finished
- StrCpy $2 $3 1 ;Cut off the first character
- StrCpy $3 $3 "" 1 ;Remainder of string
- StrCmp $2 "." is_dot not_dot ;Move to next part if it's a dot
-
- is_dot:
- IntOp $4 $4 + 1 ; Move to the next section
- goto parse ;Carry on parsing
-
- not_dot:
- IntCmp $4 1 major_ver
- IntCmp $4 2 minor_ver
- IntCmp $4 3 build_ver
- IntCmp $4 4 parse_done
-
- major_ver:
- StrCpy $R1 $R1$2
- goto parse ;Carry on parsing
-
- minor_ver:
- StrCpy $R2 $R2$2
- goto parse ;Carry on parsing
-
- build_ver:
- StrCpy $R3 $R3$2
- goto parse ;Carry on parsing
-
- parse_done:
-
- IntCmp $R1 $R5 this_major_same loop this_major_more
- this_major_more:
- StrCpy $R5 $R1
- StrCpy $R6 $R2
- StrCpy $R7 $R3
- StrCpy $R8 $R4
-
- goto loop
-
- this_major_same:
- IntCmp $R2 $R6 this_minor_same loop this_minor_more
- this_minor_more:
- StrCpy $R6 $R2
- StrCpy $R7 R3
- StrCpy $R8 $R4
- goto loop
-
- this_minor_same:
- IntCmp $R3 $R7 loop loop this_build_more
- this_build_more:
- StrCpy $R7 $R3
- StrCpy $R8 $R4
- goto loop
+ IfErrors NotDetected
- done:
+ ${If} $0 >= 393295
+ StrCpy $0 "1"
+ ${Else}
+ NotDetected:
+ StrCpy $0 "2"
+ ${EndIf}
- ;Have we got the framework we need?
- IntCmp $R5 ${MIN_FRA_MAJOR} max_major_same fail OK
- max_major_same:
- IntCmp $R6 ${MIN_FRA_MINOR} max_minor_same fail OK
- max_minor_same:
- IntCmp $R7 ${MIN_FRA_BUILD} OK fail OK
-
- ;Version on machine is greater than what we need
- OK:
- StrCpy $0 "1"
- goto end
-
- fail:
- StrCmp $R8 "0.0.0" end
-
-
- end:
-
- ;Pop the variables we pushed earlier
- Pop $R8
- Pop $R7
- Pop $R6
- Pop $R5
- Pop $R4
- Pop $R3
- Pop $R2
- Pop $R1
- Pop $4
- Pop $3
- Pop $2
- Pop $1
FunctionEnd \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Installer/MakeNightly.nsi.tmpl b/win/CS/HandBrakeWPF/Installer/MakeNightly.nsi.tmpl
index 105946e70..a1df7c5d8 100644
--- a/win/CS/HandBrakeWPF/Installer/MakeNightly.nsi.tmpl
+++ b/win/CS/HandBrakeWPF/Installer/MakeNightly.nsi.tmpl
@@ -199,134 +199,17 @@ SectionEnd
;Check for .NET framework
Function CheckFrameWork
+ ; Magic numbers from http://msdn.microsoft.com/en-us/library/ee942965.aspx
+ ClearErrors
+ ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" "Release"
- ;Save the variables in case something else is using them
- Push $0
- Push $1
- Push $2
- Push $3
- Push $4
- Push $R1
- Push $R2
- Push $R3
- Push $R4
- Push $R5
- Push $R6
- Push $R7
- Push $R8
-
- StrCpy $R5 "0"
- StrCpy $R6 "0"
- StrCpy $R7 "0"
- StrCpy $R8 "0.0.0"
- StrCpy $0 0
-
- loop:
-
- ;Get each sub key under "SOFTWARE\Microsoft\NET Framework Setup\NDP"
- EnumRegKey $1 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP" $0
- StrCmp $1 "" done ;jump to end if no more registry keys
- IntOp $0 $0 + 1
- StrCpy $2 $1 1 ;Cut off the first character
- StrCpy $3 $1 "" 1 ;Remainder of string
-
- ;Loop if first character is not a 'v'
- StrCmpS $2 "v" start_parse loop
-
- ;Parse the string
- start_parse:
- StrCpy $R1 ""
- StrCpy $R2 ""
- StrCpy $R3 ""
- StrCpy $R4 $3
-
- StrCpy $4 1
-
- parse:
- StrCmp $3 "" parse_done ;If string is empty, we are finished
- StrCpy $2 $3 1 ;Cut off the first character
- StrCpy $3 $3 "" 1 ;Remainder of string
- StrCmp $2 "." is_dot not_dot ;Move to next part if it's a dot
-
- is_dot:
- IntOp $4 $4 + 1 ; Move to the next section
- goto parse ;Carry on parsing
-
- not_dot:
- IntCmp $4 1 major_ver
- IntCmp $4 2 minor_ver
- IntCmp $4 3 build_ver
- IntCmp $4 4 parse_done
-
- major_ver:
- StrCpy $R1 $R1$2
- goto parse ;Carry on parsing
-
- minor_ver:
- StrCpy $R2 $R2$2
- goto parse ;Carry on parsing
-
- build_ver:
- StrCpy $R3 $R3$2
- goto parse ;Carry on parsing
-
- parse_done:
-
- IntCmp $R1 $R5 this_major_same loop this_major_more
- this_major_more:
- StrCpy $R5 $R1
- StrCpy $R6 $R2
- StrCpy $R7 $R3
- StrCpy $R8 $R4
-
- goto loop
-
- this_major_same:
- IntCmp $R2 $R6 this_minor_same loop this_minor_more
- this_minor_more:
- StrCpy $R6 $R2
- StrCpy $R7 R3
- StrCpy $R8 $R4
- goto loop
-
- this_minor_same:
- IntCmp $R3 $R7 loop loop this_build_more
- this_build_more:
- StrCpy $R7 $R3
- StrCpy $R8 $R4
- goto loop
+ IfErrors NotDetected
- done:
+ ${If} $0 >= 393295
+ StrCpy $0 "1"
+ ${Else}
+ NotDetected:
+ StrCpy $0 "2"
+ ${EndIf}
- ;Have we got the framework we need?
- IntCmp $R5 ${MIN_FRA_MAJOR} max_major_same fail OK
- max_major_same:
- IntCmp $R6 ${MIN_FRA_MINOR} max_minor_same fail OK
- max_minor_same:
- IntCmp $R7 ${MIN_FRA_BUILD} OK fail OK
-
- ;Version on machine is greater than what we need
- OK:
- StrCpy $0 "1"
- goto end
-
- fail:
- StrCmp $R8 "0.0.0" end
-
-
- end:
-
- ;Pop the variables we pushed earlier
- Pop $R8
- Pop $R7
- Pop $R6
- Pop $R5
- Pop $R4
- Pop $R3
- Pop $R2
- Pop $R1
- Pop $4
- Pop $3
- Pop $2
- Pop $1
FunctionEnd \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Installer/MakeNightly64.nsi.tmpl b/win/CS/HandBrakeWPF/Installer/MakeNightly64.nsi.tmpl
index ee5cb21b4..f1b2f8d6e 100644
--- a/win/CS/HandBrakeWPF/Installer/MakeNightly64.nsi.tmpl
+++ b/win/CS/HandBrakeWPF/Installer/MakeNightly64.nsi.tmpl
@@ -199,134 +199,17 @@ SectionEnd
;Check for .NET framework
Function CheckFrameWork
+ ; Magic numbers from http://msdn.microsoft.com/en-us/library/ee942965.aspx
+ ClearErrors
+ ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" "Release"
- ;Save the variables in case something else is using them
- Push $0
- Push $1
- Push $2
- Push $3
- Push $4
- Push $R1
- Push $R2
- Push $R3
- Push $R4
- Push $R5
- Push $R6
- Push $R7
- Push $R8
-
- StrCpy $R5 "0"
- StrCpy $R6 "0"
- StrCpy $R7 "0"
- StrCpy $R8 "0.0.0"
- StrCpy $0 0
-
- loop:
-
- ;Get each sub key under "SOFTWARE\Microsoft\NET Framework Setup\NDP"
- EnumRegKey $1 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP" $0
- StrCmp $1 "" done ;jump to end if no more registry keys
- IntOp $0 $0 + 1
- StrCpy $2 $1 1 ;Cut off the first character
- StrCpy $3 $1 "" 1 ;Remainder of string
-
- ;Loop if first character is not a 'v'
- StrCmpS $2 "v" start_parse loop
-
- ;Parse the string
- start_parse:
- StrCpy $R1 ""
- StrCpy $R2 ""
- StrCpy $R3 ""
- StrCpy $R4 $3
-
- StrCpy $4 1
-
- parse:
- StrCmp $3 "" parse_done ;If string is empty, we are finished
- StrCpy $2 $3 1 ;Cut off the first character
- StrCpy $3 $3 "" 1 ;Remainder of string
- StrCmp $2 "." is_dot not_dot ;Move to next part if it's a dot
-
- is_dot:
- IntOp $4 $4 + 1 ; Move to the next section
- goto parse ;Carry on parsing
-
- not_dot:
- IntCmp $4 1 major_ver
- IntCmp $4 2 minor_ver
- IntCmp $4 3 build_ver
- IntCmp $4 4 parse_done
-
- major_ver:
- StrCpy $R1 $R1$2
- goto parse ;Carry on parsing
-
- minor_ver:
- StrCpy $R2 $R2$2
- goto parse ;Carry on parsing
-
- build_ver:
- StrCpy $R3 $R3$2
- goto parse ;Carry on parsing
-
- parse_done:
-
- IntCmp $R1 $R5 this_major_same loop this_major_more
- this_major_more:
- StrCpy $R5 $R1
- StrCpy $R6 $R2
- StrCpy $R7 $R3
- StrCpy $R8 $R4
-
- goto loop
-
- this_major_same:
- IntCmp $R2 $R6 this_minor_same loop this_minor_more
- this_minor_more:
- StrCpy $R6 $R2
- StrCpy $R7 R3
- StrCpy $R8 $R4
- goto loop
-
- this_minor_same:
- IntCmp $R3 $R7 loop loop this_build_more
- this_build_more:
- StrCpy $R7 $R3
- StrCpy $R8 $R4
- goto loop
+ IfErrors NotDetected
- done:
+ ${If} $0 >= 393295
+ StrCpy $0 "1"
+ ${Else}
+ NotDetected:
+ StrCpy $0 "2"
+ ${EndIf}
- ;Have we got the framework we need?
- IntCmp $R5 ${MIN_FRA_MAJOR} max_major_same fail OK
- max_major_same:
- IntCmp $R6 ${MIN_FRA_MINOR} max_minor_same fail OK
- max_minor_same:
- IntCmp $R7 ${MIN_FRA_BUILD} OK fail OK
-
- ;Version on machine is greater than what we need
- OK:
- StrCpy $0 "1"
- goto end
-
- fail:
- StrCmp $R8 "0.0.0" end
-
-
- end:
-
- ;Pop the variables we pushed earlier
- Pop $R8
- Pop $R7
- Pop $R6
- Pop $R5
- Pop $R4
- Pop $R3
- Pop $R2
- Pop $R1
- Pop $4
- Pop $3
- Pop $2
- Pop $1
FunctionEnd \ No newline at end of file