Talk:Driver installation and update: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
m (extra functionality) |
No edit summary |
||
Line 1: | Line 1: | ||
== | == Extra functionality == | ||
I've used this function to install drivers. And in some circumstances I had to install an older driver over a new one, for this, i've changed the fourth parameter (flags) to 1 (INSTALLFLAG_FORCE) and it did the work. | I've used this function to install drivers. And in some circumstances I had to install an older driver over a new one, for this, i've changed the fourth parameter (flags) to 1 (INSTALLFLAG_FORCE) and it did the work. | ||
Line 10: | Line 10: | ||
[[User:Rafael Vargas|Rafael Vargas]] 09:37, 27 August 2008 (PDT) | [[User:Rafael Vargas|Rafael Vargas]] 09:37, 27 August 2008 (PDT) | ||
== Alternative to GetWindowsVersion == | |||
Instead of using the following block of code: | |||
<highlight-nsis> | |||
; Get the Windows version | |||
Call GetWindowsVersion | |||
Pop $R3 ; Windows Version | |||
;DetailPrint 'Windows Version: $R3' | |||
StrCmp $R3 '2000' lbl_upgrade | |||
StrCmp $R3 'XP' lbl_upgrade | |||
StrCmp $R3 '2003' lbl_upgrade | |||
DetailPrint "Windows $R3 doesn't support automatic driver updates." | |||
</highlight-nsis> | |||
You could use this one (built-in function in winver.nsh): | |||
<highlight-nsis> | |||
${If} ${AtLeastWin2000} | |||
Goto lbl_upgrade | |||
${EndIf} | |||
DetailPrint "This Windows version doesn't support automatic driver updates." | |||
</highlight-nsis> | |||
If you use it, '''$R3''' will be empty so make sure all the places were it is shown are modified. |
Revision as of 15:36, 16 December 2008
Extra functionality
I've used this function to install drivers. And in some circumstances I had to install an older driver over a new one, for this, i've changed the fourth parameter (flags) to 1 (INSTALLFLAG_FORCE) and it did the work.
System::Call '${sysUpdateDriverForPlugAndPlayDevices}?e (0, R0, R1, 1, 0) .r0'
Maybe someone could add the this as an optional functionality to this function...
Rafael Vargas 09:37, 27 August 2008 (PDT)
Alternative to GetWindowsVersion
Instead of using the following block of code:
; Get the Windows version Call GetWindowsVersion Pop $R3 ; Windows Version ;DetailPrint 'Windows Version: $R3' StrCmp $R3 '2000' lbl_upgrade StrCmp $R3 'XP' lbl_upgrade StrCmp $R3 '2003' lbl_upgrade DetailPrint "Windows $R3 doesn't support automatic driver updates."
You could use this one (built-in function in winver.nsh):
${If} ${AtLeastWin2000} Goto lbl_upgrade ${EndIf} DetailPrint "This Windows version doesn't support automatic driver updates."
If you use it, $R3 will be empty so make sure all the places were it is shown are modified.