Par contre, il est IMPERATIF de sauvegarder ton BIOS. La procédure d'HP devrait le proposer mais je ne peux pas tester...
C'est marrant, installer.exe d'HP est en fait un WinBatch...
Code : Tout sélectionner
[;A@@@@AW:\Patches\IP\sp35154\Installer.wbt
IntControl( 50, 0, 0, 0, 0) ; Remove "Go to web page" button from WIL error boxes.
IntControl( 12, 8, 0, 0, 0)
IntControl( 29, @TAB, 0, 0, 0)
IntControl(1002, 0, 0, 0, 0)
IntControl(1003, 1, 0, 0, 0)
InStudio = (rtStatus() == 10)
Status=259
IntControl(1000, Status, 0, 0, 0)
WinDir=DirWindows(0)
MyEXEname=IntControl(1004, 0, 0, 0, 0)
CurrentDir=DirGet()
DevMode=@FALSE
IF FileExtension(MyEXEname)=="wbt" Then DevMode=@TRUE
MyPath=FilePath( MyEXEname )
MyTitle="Windows Based BIOS Update"
WinTitle("",MyTitle)
#DefineFunction GetRegValue(Key)
;A@@@@uW:\Patches\IP\sp35154\Installer.wbt
if StrIndex(Key,"HKEY_LOCAL_MACHINE\",1,@FWDSCAN) > 0 Then
handle= @REGMACHINE
Key=StrReplace(Key,"HKEY_LOCAL_MACHINE\","")
End If
if StrIndex(Key,"HKEY_CURRENT_USER\",1,@FWDSCAN) > 0 Then
handle= @REGCURRENT
Key=StrReplace(Key,"HKEY_CURRENT_USER\","")
End If
if RegExistValue(handle, Key) == 1 Then
regkey=RegQueryValue(@REGMachine, Key)
regkey=StrReplace(regkey,"\\","\")
Else
regkey="None"
Endif
RETURN regkey
#EndFunction
HPSUFlag = AppExist("HPWUCli.exe")
If !HPSUFlag Then
Message (MyTitle, "Please close any applications and save your files before proceeding.%@CRLF%%@CRLF%It is a good idea to back up your data before continuing...")
q=AskYesNo(MyTitle, "This utility will update your BIOS.%@CRLF%Press YES to proceed.%@CRLF%%@CRLF%WARNING!!! Do NOT turn off your PC during this update...")
If q==@NO Then
Exit
EndIf
EndIf
If !HPSUFlag Then BoxOpen(MyTitle, "Please wait... update in progress...%@CRLF%%@CRLF%WARNING!!! Do NOT power off your PC!")
ErrorMode(@OFF)
Test=FileOpen("C:\Test.txt", "WRITE")
If Test == 0
Status=9999
Goto Validate
Else
FileWrite(Test, "This is a test for administrator rights.")
FileClose(Test)
FileDelete("C:\Test.txt")
EndIf
ErrorMode(@CANCEL)
Locator = ObjectOpen("WbemScripting.SWbemLocator")
Service = Locator.ConnectServer()
Security = Service.Security_
Security.ImpersonationLevel = 3
Class = "Win32_OperatingSystem"
Instance = Service.InstancesOf(Class)
hEnum = ObjectCollectionOpen(Instance)
While 1
Obj = ObjectCollectionNext(hEnum)
If Obj == 0 Then Break
Caption=obj.Caption
EndWhile
ObjectCollectionClose(hEnum)
ObjectClose(Instance)
ObjectClose(Security)
ObjectClose(Service)
ObjectClose(Locator)
If StrIndexNc(Caption, "Vista", 1, @FWDSCAN) == 0 Then
Status=9998
Goto Validate
EndIf
Locator = ObjectOpen("WbemScripting.SWbemLocator")
Service = Locator.ConnectServer()
Security = Service.Security_
Security.ImpersonationLevel = 3
Class = "Win32_OperatingSystem"
Instance = Service.InstancesOf(Class)
hEnum = ObjectCollectionOpen(Instance)
While 1
Obj = ObjectCollectionNext(hEnum)
If Obj == 0 Then Break
OSArchitecture=obj.OSArchitecture
EndWhile
ObjectCollectionClose(hEnum)
ObjectClose(Instance)
ObjectClose(Security)
ObjectClose(Service)
ObjectClose(Locator)
If StrIndex(OSArchitecture, "32", 1, @FWDSCAN) == 0 Then
Status=9997
Goto Validate
EndIf
RunShell("regsvr32.exe", '/s "%CurrentDir%cpc_DMIRD.dll"', "", @NORMAL, @WAIT)
Flex=ObjectOpen("cPC_DMIRDll.cPC_DMIRDllImpl")
BuildIDType11=Flex.GETBID()
AllOptionsType11=Flex.GETALLOPTIONSTYPE11()
ObjectClose(Flex)
If (FileExist("c:\windows\System32\cPC_DMIRD.dll")==@TRUE) Then
RunShell("regsvr32.exe", "/s cPC_DMIRD.dll", "", @HIDDEN, @WAIT)
EndIf
Cycle="71"
MyCycle=StrSub(BuildIDType11, 1, 2)
If !(MyCycle>=Cycle) Then
Status=9996
Goto Validate
EndIf
ProductName=GetRegValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion[ProductName]")
BIOSFLASH="Software\Hewlett-Packard\BIOSFLASH"
RtnStatus="%BIOSFLASH%[RtnStatus]"
ErrorMessage="%BIOSFLASH%[ErrorMessage]"
ERRORMODE (@OFF)
status=RegDeleteKey( @REGCURRENT, BIOSFLASH )
if InStudio then
ParamCount=3
param1="WinFlash.exe"
param2="/PN"
param3="/auto:303a.rom"
dir="C:\"
DirChange(dir)
else
ParamCount=param0
dir="."
end if
If !ParamCount Then BoxShut()
Terminate(!ParamCount,MyTitle,"Proper command line parameters were not passed.%@CRLF%No action taken.")
Arguments=""
FlashUtil=param1
if ParamCount > 1 then Arguments=StrCat(Arguments," %param2%")
if ParamCount > 2 then Arguments=StrCat(Arguments," %param3%")
if ParamCount > 3 then Arguments=StrCat(Arguments," %param4%")
if ParamCount > 4 then Arguments=StrCat(Arguments," %param5%")
if ParamCount > 5 then Arguments=StrCat(Arguments," %param6%")
if ParamCount > 6 then Arguments=StrCat(Arguments," %param7%")
if ParamCount > 7 then Arguments=StrCat(Arguments," %param8%")
Arguments=StrTrim(Arguments) ;
ERRORMODE (@CANCEL)
status=RunHideWait( "%dir%\%FlashUtil%", Arguments )
If !HPSUFlag Then
If !Status then BoxShut()
Terminate(!Status,MyTitle,"Error starting the flashing program.%@CRLF%No action taken.")
EndIf
Status=RegExistValue( @REGCURRENT, RtnStatus )
If !HPSUFlag Then
If !Status Then BoxShut()
Terminate(!Status,MyTitle,"Flashing program did not complete normally.%@CRLF%No action taken.")
EndIf
ErrStat=LastError()
Status=RegQueryDword( @REGCURRENT, RtnStatus )
ErrStat=LastError()
If ErrStat==1489 then
If !HPSUFlag Then BoxShut()
Terminate(ErrStat,MyTitle,"Error retrieving return status.%@CRLF%Flashing program did not complete normally.")
end if
If Status==0 Then
Status=3010
Today=StrFix(TimeYmdHms ( ), "", 10)
RegSetValue(@REGCURRENT, "Software\Hewlett-Packard\BIOSFLASH[LastUpdate]", Today)
AppWaitClose("flash.exe")
EndIf
:Validate
IntControl(1000, Status, 0, 0, 0)
If !HPSUFlag Then BoxShut()
Switch Status
Case 251
If !HPSUFlag Then (Message(MyTitle, "Incompatible flash part (%Status%).%@CRLF%Please download patch again.%@CRLF%If error continues, contact support."))
Goto Finish
Case 252
If !HPSUFlag Then (Message(MyTitle,"System BIOS image is invalid or corrupt (%Status%).%@CRLF%Please download patch again.%@CRLF%If error continues, contact support."))
Goto Finish
Break
Case 253
If !HPSUFlag Then (Message(MyTitle,"Incorrect BIOS for your system (%Status%).%@CRLF%Please download patch again.%@CRLF%If error continues, contact support."))
Goto Finish
Break
Case 3010
If !HPSUFlag Then
If AskYesNo(MyTitle, "Update has completed.%@CRLF%Save any documents, close all applications, and click YES to restart your system.")==@Yes Then
IntControl(67, 0, 0, 0, 0)
EndIf
EndIf
Goto Finish
Break
Case 9996
If !HPSUFlag Then (Message(MyTitle, "Your system does not meet the minimum requirements for this update.%@CRLF%Update has been cancelled. (%Status%)"))
Goto Finish
Break
Case 9997
If !HPSUFlag Then (Message(MyTitle, "Your system does not meet the minimum requirements for this update.%@CRLF%Update has been cancelled. (%Status%)"))
Goto Finish
Break
Case 9998
If !HPSUFlag Then (Message(MyTitle, "Your system does not meet the minimum requirements for this update.%@CRLF%Update has been cancelled. (%Status%)"))
Goto Finish
Break
Case 9999
If !HPSUFlag Then (Message(MyTitle, "You must be logged on as an administrator to install this update.%@CRLF%Update has been cancelled. (%Status%)"))
Goto Finish
Break
Case Status
If !HPSUFlag Then (Message(MyTitle,"Unable to update system BIOS (%Status%).%@CRLF%Please try again.%@CRLF%If the error continues, contact support."))
Goto Finish
Break
EndSwitch
:Finish
Exit