VirtualBox

Changeset 109163 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
May 5, 2025 6:00:52 PM (4 days ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168721
Message:

Windows Additions installer: Got rid of the ancient servicepack.nsh + winver.nsh and use the official (included with NSIS) WinVer.nsh (in Include\WinVer.nsh). This also makes use if the ${AtLeastWinXXX} macros and stuff to improve code readability.

Location:
trunk/src/VBox/Additions/WINNT/Installer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh

    r109138 r109163  
    5858
    5959  ; Init global variables that depends on the Windows version.
    60   ${If} $g_strWinVersion == "XP"
     60  ${If} ${AtLeastWinVista}
     61    StrCpy $g_strEarlyNTDrvInfix ""
     62  ${Else}
    6163    StrCpy $g_strEarlyNTDrvInfix "EarlyNT"
    62   ${ElseIf} $g_strWinVersion == "2000"
    63     StrCpy $g_strEarlyNTDrvInfix "EarlyNT"
    64   ${ElseIf} $g_strWinVersion == "NT4"
    65     StrCpy $g_strEarlyNTDrvInfix "EarlyNT"
    66   ${Else}
    67     StrCpy $g_strEarlyNTDrvInfix ""
    6864  ${EndIf}
    6965
     
    148144    FILE "$%PATH_OUT%\bin\additions\VBoxGuest.cat"
    149145  !else
    150   ${If} $g_strWinVersion == "10"
     146  ${If} ${AtLeastWin10}
    151147    FILE "$%PATH_OUT%\bin\additions\VBoxGuest.cat"
    152148  ${Else}
     
    166162    FILE "$%PATH_OUT%\bin\additions\VBoxMouse.cat"
    167163  !else
    168     ${If} $g_strWinVersion == "10"
     164    ${If} ${AtLeastWin10}
    169165      FILE "$%PATH_OUT%\bin\additions\VBoxMouse.cat"
    170166    ${Else}
     
    193189!ifdef VBOX_SIGN_ADDITIONS
    194190  !if $%KBUILD_TARGET_ARCH% != "arm64" ;; @todo win.arm64: Ditto.
    195     ${If} $g_strWinVersion == "10"
     191    ${If} ${AtLeastWin10}
    196192      FILE "$%PATH_OUT%\bin\additions\VBoxVideo.cat"
    197193    ${Else}
     
    213209        FILE "$%PATH_OUT%\bin\additions\VBoxWddm.cat"
    214210      !else
    215       ${If} $g_strWinVersion == "10"
     211      ${If} ${AtLeastWin10}
    216212        FILE "$%PATH_OUT%\bin\additions\VBoxWddm.cat"
    217213      ${Else}
     
    249245  ; Shared Folders driver
    250246  ;
    251   ${If}   $g_strWinVersion <> "NT4" ; Only available for > NT4.
     247  ${If}   ${AtLeastWin2000} ; Only available for > NT4.
    252248  ${OrIf} $g_bOnlyExtract == "true"
    253249    SetOutPath "$INSTDIR\VBoxSF"
     
    273269  ;
    274270!ifdef VBOX_SIGN_ADDITIONS
    275   ${If}   $g_strWinVersion <> "NT4" ; Only required for > NT4.
     271  ${If}   ${AtLeastWin2000} ; Only required for > NT4.
    276272  ${OrIf} $g_bOnlyExtract == "true"
    277273    SetOutPath "$INSTDIR\Cert"
     
    294290  ;
    295291  SetOutPath "$INSTDIR\Tools"
    296 ${If} $g_strWinVersion <> "NT4" ; VBoxDrvInst only works with > NT4.
    297   FILE "$%PATH_OUT%\bin\additions\VBoxDrvInst.exe"
    298   AccessControl::SetOnFile "$INSTDIR\VBoxDrvInst.exe" "(BU)" "GenericRead"
    299 ${EndIf}
     292  ${If} ${AtLeastWin2000} ; VBoxDrvInst only works with > NT4.
     293    FILE "$%PATH_OUT%\bin\additions\VBoxDrvInst.exe"
     294    AccessControl::SetOnFile "$INSTDIR\VBoxDrvInst.exe" "(BU)" "GenericRead"
     295  ${EndIf}
    300296  FILE "$%PATH_OUT%\bin\additions\VBoxGuestInstallHelper.exe"
    301297  AccessControl::SetOnFile "$INSTDIR\VBoxGuestInstallHelper.exe" "(BU)" "GenericRead"
     
    402398
    403399  ${LogVerbose} "Stopping VBoxService via SCM ..."
    404   ${If} $g_strWinVersion == "NT4"
     400  ${If} ${AtMostWinNT4}
    405401    nsExec::Exec '"$SYSDIR\net.exe" stop VBoxService'
    406402  ${Else}
     
    537533
    538534  ; Does the guest have a DLL cache?
    539   ${If}   $g_strWinVersion == "NT4"     ; bird: NT4 doesn't have a DLL cache, WTP is 5.0 <= NtVersion < 6.0.
    540   ${OrIf} $g_strWinVersion == "2000"
    541   ${OrIf} $g_strWinVersion == "XP"
     535  ${If}   ${IsWin2000}
     536  ${OrIf} ${IsWinXP}
    542537    StrCpy $g_bCapDllCache "true"
    543538    ${LogVerbose}  "OS has a DLL cache"
    544539  ${EndIf}
    545540
    546   ${If}   $g_strWinVersion == "2000"
    547   ${OrIf} $g_strWinVersion == "XP"
    548   ${OrIf} $g_strWinVersion == "2003"
    549   ${OrIf} $g_strWinVersion == "Vista"
    550   ${OrIf} $g_strWinVersion == "7"
     541  ${If} ${AtLeastWin2000}
    551542    StrCpy $g_bCapXPDM "true"
    552543    ${LogVerbose} "OS is XPDM driver capable"
     
    555546!if $%VBOX_WITH_WDDM% == "1"
    556547  ; By default use the WDDM driver on Vista+.
    557   ${If}   $g_strWinVersion == "Vista"
    558   ${OrIf} $g_strWinVersion == "7"
    559   ${OrIf} $g_strWinVersion == "8"
    560   ${OrIf} $g_strWinVersion == "8_1"
    561   ${OrIf} $g_strWinVersion == "10"
     548  ${If} ${AtLeastWinVista}
    562549    StrCpy $g_bWithWDDM "true"
    563550    StrCpy $g_bCapWDDM "true"
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsW2KXP.nsh

    r109138 r109163  
    9191
    9292  ; If we're on Windows 2000, skip the ID detection ...
    93   ${If} $g_strWinVersion == "2000"
     93  ${If} ${IsWin2000}
    9494    Goto change_res
    9595  ${EndIf}
     
    133133  Var /GLOBAL reg_path_monitor
    134134
    135   ${LogVerbose} "Custom mode set: Platform is Windows $g_strWinVersion"
    136   ${If} $g_strWinVersion == "2000"
    137   ${OrIf} $g_strWinVersion == "Vista"
     135  ${If}     ${IsWin2000}
    138136    StrCpy $reg_path_device "SYSTEM\CurrentControlSet\SERVICES\VBoxVideo\Device0"
    139137    StrCpy $reg_path_monitor "SYSTEM\CurrentControlSet\SERVICES\VBoxVideo\Device0\Mon00000001"
    140   ${ElseIf} $g_strWinVersion == "XP"
    141   ${OrIf} $g_strWinVersion == "7"
    142   ${OrIf} $g_strWinVersion == "8"
    143   ${OrIf} $g_strWinVersion == "8_1"
    144   ${OrIf} $g_strWinVersion == "10"
     138  ${ElseIf} ${IsAtLeastWinXP}
    145139    StrCpy $reg_path_device "SYSTEM\CurrentControlSet\Control\Video\$dev_id\0000"
    146140    StrCpy $reg_path_monitor "SYSTEM\CurrentControlSet\Control\VIDEO\$dev_id\0000\Mon00000001"
    147141  ${Else}
    148     ${LogVerbose} "Custom mode set: Windows $g_strWinVersion not supported yet"
     142    ${LogVerbose} "Custom mode set: Windows $g_strWinVersion not supported, skipping"
    149143    Goto exit
    150144  ${EndIf}
     
    300294  ; to do. On guest OSes < Windows 10 we always go for the PreW10 security
    301295  ; catalog files (.cat) and there we install our legacy timestamp CA by default.
    302   ${If}    $g_bInstallTimestampCA == "unset"
    303   ${AndIf} $g_strWinVersion != "10"
    304       StrCpy $g_bInstallTimestampCA "true"
     296  ${If}       $g_bInstallTimestampCA == "unset"
     297  ${AndIfNot} ${AtLeastWin10}
     298    StrCpy $g_bInstallTimestampCA "true"
    305299  ${EndIf}
    306300  ${If} $g_bInstallTimestampCA == "true"
     
    319313  ; Note that VBOX_GA_CERT_ROOT_SHA1 may be a SHA-2 cert, the hash algorithm
    320314  ; refers to the windows signature structures not the certificate.
    321   ${If} $g_strWinVersion != "2000"
     315  ${If} ${AtLeastWinXP}
    322316  !if  "$%VBOX_GA_CERT_ROOT_SHA2%" != "none"
    323317    Push "SHA-2 root"
     
    576570    !if $%KBUILD_TARGET_ARCH% == "x86"
    577571      ; On x86 we have to use a different shared folder driver linked against an older RDBSS for Windows 7 and older.
    578       ${If}   $g_strWinVersion == "2000"
    579       ${OrIf} $g_strWinVersion == "XP"
    580       ${OrIf} $g_strWinVersion == "2003"
    581       ${OrIf} $g_strWinVersion == "7"
     572      ${If}     ${AtLeastWin2000}
     573      ${AndIf}  ${AtMostWin7}
    582574        !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\VBoxSFW2K.sys" "$g_strSystemDir\drivers\VBoxSF.sys" "$INSTDIR"
    583       ${Else}
     575      ${ElseIf} ${AtLeastWin8}
    584576        !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$%PATH_OUT%\bin\additions\VBoxSF.sys" "$g_strSystemDir\drivers\VBoxSF.sys" "$INSTDIR"
    585577      ${EndIf}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette