How disable Warn while install driver protected by OS

Discussion in 'Windows XP / Older OS' started by Gelip, Jan 18, 2024.

  1. Gelip

    Gelip MDL Senior Member

    Feb 28, 2011
    407
    273
    10
    OS - WinXP SP2 64-bit

    I trying to install over sysprep.exe the ported NVMe driver that replaces the protected storport.sys file. I have the right options in the sysprep.inf file but they only work with drivers that do not modify system files:
    Code:
    [Unattended]
        OemSkipEula=Yes
        ConfirmHardware=No
        DriverSigningPolicy=Ignore
        NonDriverSigningPolicy=Ignore
        UpdateInstalledDrivers=Yes
    During the installation of the NVMe driver, a warning appears twice where I have to click the Continue Anyway button to continue:
    storport_sys_sysprep.png
    At setupapi.log I have such a message:
    Code:
    #-336 Copying file "c:\drivers\2_nvme\storport.sys" to "C:\WINDOWS\system32\DRIVERS\storport.sys" via temporary file "C:\WINDOWS\system32\DRIVERS\SET1C.tmp".
    #E245 The device installation digital signature failure policy has been elevated from Ignore to Warn due to a proposed replacement of a protected system file.
    #W366 An unsigned, incorrectly signed, or Authenticode(tm) signed file "c:\drivers\2_nvme\storport.sys" for driver "Standardowy kontroler NVM Express" will be installed (Policy=Warn, user said ok). Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
    #E243 Exemption obtained for protected system file "C:\WINDOWS\system32\DRIVERS\storport.sys".
    How to make the system not display this warning?
     
  2. George King

    George King MDL Expert

    Aug 5, 2009
    1,961
    2,468
    60
    I quess patching SFC or SFCFILES protection removal method should do that job.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,003
    2,944
    150

    One thing I always asked myself is how the bluetooth stack installers (like Widcomm, but likely also Toshiba) managed to overcome the problem.

    They managed to install unsigned drivers w/o any user intervention and w/o disabling permanently the SFC, driver signature enforcement or whatever.

    I never investigated the matter myself but is definitely something that deserved more attention.
     
  4. Gelip

    Gelip MDL Senior Member

    Feb 28, 2011
    407
    273
    10
    I just found how to patch sfc_os.dll from WinXP 32-bit SP1 - change the values "8B C6" to read "90 90"
     
  5. George King

    George King MDL Expert

    Aug 5, 2009
    1,961
    2,468
    60
    @Gelip SFC fo 5.2 x64 patch that I have is different and works too.
    Code:
    C1 44 01 00 75  ->  C1 44 01 00 EB
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Gelip

    Gelip MDL Senior Member

    Feb 28, 2011
    407
    273
    10
    @George King
    Do you need entry SFCDisable ffffff9d in the registry?
     
  7. George King

    George King MDL Expert

    Aug 5, 2009
    1,961
    2,468
    60
    I think, yes, its driveable using registry with this patch.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Gelip

    Gelip MDL Senior Member

    Feb 28, 2011
    407
    273
    10
    Unfortunately it does not work. I remove the file by hand, e.g. storport.sys and after a while it appears again.
     
  9. George King

    George King MDL Expert

    Aug 5, 2009
    1,961
    2,468
    60
    Not sure, it both keys must be there.
    Code:
    REM Disable SFC
    reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "SFCDisable" /t REG_DWORD /d "4294967197" /f >nul
    reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "SFCSetting" /t REG_DWORD /d "4294967197" /f >nul
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Gelip

    Gelip MDL Senior Member

    Feb 28, 2011
    407
    273
    10
  11. Gelip

    Gelip MDL Senior Member

    Feb 28, 2011
    407
    273
    10
    #11 Gelip, Jan 19, 2024
    Last edited: Jan 19, 2024
    (OP)
    Ok, I found a way that works 100% ;)
    • create D:\sourc folder then copy all content from WinXP SP2 64-bit ISO
    • using Total Uninstall 2.35 make scan D:\sourc only
    • in next step in Total Uninstall run nLite 1.4.9.3 and patch SFC
      Options > Next > Patches tab > SFC (Windows File Protection) > Disable
    • next step Total Uninstall scan D:\sourc and detect changes
    • nLite patch the SFC_OS.DL_ file:
      Code:
        140:    CC    67
        141:    6D    B0
      139C2:    41    90
      139C3:    0F    90
      139C4:    44    90
      139C5:    CF    90
      
      6 difference(s) found. 
      and set registry in HIVESFT.INF
      Code:
      HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","SfcDisable",0x00010001,0xFFFFFF9D
    • also HIVESFT32.INF for 32-bit subsystem but works without it
      Code:
      HKLM,"SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Winlogon","SfcDisable",0x00010001,0xFFFFFF9D
    • it is enough to unpack the sfc_os.dll file from SFC_OS.DL_ using 7-Zip and replace it outside the operating system and edit in registry the SFCDisable ffffff9d value, e.g. in offline mode, loading hive the Software of target os
    • after sysprep.exe add drivers SFCDisable value 0 can be restored to enable SFC - it works with a patched version
    sfc_disable_nlite.png scan_sourc.png nlite_files.png
     
  12. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,486
    92,757
    340
    https://forums.mydigitallife.net/posts/840982/

    :D
     
  13. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,003
    2,944
    150
    Yeah, I remember this, but I dont think it's the way used by widcomm.

    In their setup IIRC you see the usual popups about unsigned drivers, then those popups are closed automatically and the installation proceeds normally (even in x64)
     
  14. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,486
    92,757
    340
  15. George King

    George King MDL Expert

    Aug 5, 2009
    1,961
    2,468
    60
    I still quess they hack SFCFILES as it's not protected itself. So you can edit list with protected files and just remove it from there
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,003
    2,944
    150
    Sure something like that.

    But that works for sure in 32bit, in x64 a unsigned driver is supposed to be not installable, so, no matter how you automate the button pushing, something more is needed.

    Maybe a combination of both the above techniques, maybe something else
     
  17. George King

    George King MDL Expert

    Aug 5, 2009
    1,961
    2,468
    60
    Installing of "unsigned" driver on x64 (6.0+) involve generating signing certificate for testing (for example), and then installer can easily add it to registry and install that driver without any prompt.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,003
    2,944
    150

    Yes but once you have the self signed driver, you have to reboot to have the test-mode in place, which isn't what happens with bluetooth stacks
     
  19. George King

    George King MDL Expert

    Aug 5, 2009
    1,961
    2,468
    60
    No, you don't need to reboot. And no need to go to TEST Mode with these drivers.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  20. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,003
    2,944
    150
    Whatever... it's an era I don't install the widcomm stack (and the toshiba one I use currently has properly signed drivers), so discussing further about the matter would be pointless until my laziness let me to retest them and investigate further.