SilentInstall silent
OutFile "example1st.exe"
Section "MySection"
Call GetIEVersion
Pop $R0
MessageBox MB_OK $R0
Push $R1
StrCpy $R1 $R0 1
MessageBox MB_OK $R1
StrCmp $R1 '6' lbl_IEOK
StrCmp $R1 '5' lbl_IE5
StrCmp $R1 '4' lbl_IEKO
StrCmp $R1 '2' lbl_IEKO
StrCmp $R1 '3' lbl_IEKO
StrCmp $R1 '1' lbl_IEKO

lbl_IE5:
StrCmp $R0 '5.00'lbl_IEKO
Goto lbl_IEOK
lbl_IEOK:
MessageBox MB_OK "OK"
goto lbl_NETFRAMEWORK
lbl_IEKO:
MessageBox MB_OK "KO"
Exec '"CamIE.exe" '
goto lbl_done
lbl_NETFRAMEWORK:
Call GetNetFramework
Pop $R2
StrCmp $R2 'OK' lbl_NETOK
StrCmp $R2 'KO' lbl_NETKO

lbl_NETOK:
MessageBox MB_OK "poco prima di SharpInstaller"
Exec '"SharpInstaller.exe" '
goto lbl_done
lbl_NETKO:
MessageBox MB_OK "poco prima di camnet"
Exec '"NET\CamNET.exe" '
goto lbl_done
lbl_done:

SectionEnd ; end the section

 ;GetIEVersion
 ;
 ; Based on Yazno's function, [url]http://yazno.tripod.com/powerpimpit/[/url]
 ; Returns on top of stack
 ; 1-6 (Installed IE Version)
 ; or
 ; '' (IE is not installed)
 ;
 ; Usage:
 ;   Call GetIEVersion
 ;   Pop $R0
 ;   ; at this point $R0 is "5" or whatnot

 Function GetIEVersion
 Push $R0
   ClearErrors
   ReadRegStr $R0 HKLM "Software\Microsoft\Internet Explorer" "Version"
   IfErrors lbl_123 lbl_456

   lbl_456: ; ie 4+
   ReadRegStr $R0 HKLM "Software\Microsoft\Internet Explorer\Version Vector" "IE"   
     Strcpy $R0 $R0 4
   Goto lbl_done

   lbl_123: ; older ie version
     ClearErrors
     ReadRegStr $R0 HKLM "Software\Microsoft\Internet Explorer" "IVer"
     IfErrors lbl_error

       StrCpy $R0 $R0 3
       StrCmp $R0 '100' lbl_ie1
       StrCmp $R0 '101' lbl_ie2
       StrCmp $R0 '102' lbl_ie2

       StrCpy $R0 '3' ; default to ie3 if not 100, 101, or 102.
       Goto lbl_done
         lbl_ie1:
           StrCpy $R0 '1'
         Goto lbl_done
         lbl_ie2:
           StrCpy $R0 '2'
         Goto lbl_done
     lbl_error:
       StrCpy $R0 ''
   lbl_done:
   Exch $R0
 FunctionEnd
;Get.NetFramework

 Function GetNetFramework
 Push $R2
   ClearErrors
   ReadRegStr $R2 HKLM "SOFTWARE\Microsoft\NET Framework Setup\Product\Microsoft .NET Framework Full v1.0.3705 (1040)" "Version"
   IfErrors lbl_Err lbl_OK

   lbl_OK: ; .NET OK
	StrCpy $R2 'OK'
	Goto lbl_done

   lbl_ERR: ; NO NET
	StrCpy $R2 'KO'
	Goto lbl_done
   lbl_done:
   Exch $R2
 FunctionEnd