Help needed to make a Customized Windows 7 SP2

Discussion in 'Windows 7' started by ashish.k, Jan 7, 2016.

  1. ashish.k

    ashish.k MDL Member

    Dec 27, 2014
    204
    99
    10
    I would like to make my own Win7 ISO. No IE11, nice looking theme, some great apps etc.

    BUT here comes the catch, I would also like to have (of course) all the latest updates integrated and a "SP2" label in System Properties.
    But to get rid of all the 200+ "Installed Updates" listed in System, is that 100% mission impossible?

    I can integrate updates using Simplix pack (thanks to gamazet).
    I can do the themes/apps integration.
    After doing everything I'll sysprep/capture and make ISO.

    How can I change "Service Pack 1" label in System properties and remove all listed updates (without actually uninstalling them of course)? This is what I need help on. Also I suspect that doing so may break Windows Update, will it?
     
  2. harkaz

    harkaz MDL Novice

    Dec 27, 2012
    31
    57
    0
    To change SP number, edit this value in registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows\CSDVersion to 0x200 (512)

    To hide the installed updates use runasti to super-elevate and modify the registry under: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages. For each package key with a "Visibilty" REG_DWORD subvalue "1" change this value to "2"

    P.S. Also consider using my rebase tool to minimize the winsxs size (since you've hidden the updates you wouldn't want them to be removable as well).
     
  3. ashish.k

    ashish.k MDL Member

    Dec 27, 2014
    204
    99
    10
    #3 ashish.k, Jan 10, 2016
    Last edited by a moderator: Apr 20, 2017
    (OP)
    OK, I've changed SP1 label to SP2 in the system and it works everywhere (winver, System Properties, About option in Help). All Thanks to harkaz for pointing out the registry Keys/Values.

    Now as for hiding all updates the Value of REG_DWORD 'Visibility' must be changed to 2 instead of 1 for all Keys named "Package_for_KB*" where * is random numbers and characters. These Keys/folders are uncountable so I need an automatic solution instead of manually changing the values.
    What I need is a cmd script which I will run using RunAsTI (as suggested by harkaz).

    I've made a sample script but I know it won't work as it is just a basic idea of it. Here it is...

    Code:
    @echo off
    
    echo ============================================================
    echo WARNING! This is really dangerous.
    echo Would you like to proceed? (Y/N)
    echo ============================================================
    echo.
    choice /c yn /n
    If %ERRORLEVEL% NEQ 1 GOTO :QUIT
    
    echo Changing Registry keys
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB*" /T REG_DWORD /v "Visibility" /D 2 /F>NUL 2>NUL
    IF %ERRORLEVEL% NEQ 0 GOTO :ERROR
    echo .
    echo Registry keys changed successfully
    goto :QUIT
    
    :QUIT
    echo ============================================================
    echo Press any key to exit...
    echo ============================================================
    pause>NUL
    goto :EOF
    
    :ERROR
    echo ============================================================
    echo The script ran into an unexpected error setting reg key.
    echo Press any key to exit...
    echo ============================================================
    pause>NUL
    goto :EOF
    So I want this script to run as many times as the no. of folders named "Package_for_KB*" and change the REG_DWORD "Visibility" value from 1 to 2.

    How can I do that? :g: Please help me to do so as I'm not that good in cmd scripting. :confused:


    PS: @harkaz, I would have gladly paid you $10 for your Rebase tool but I'm just an undergraduate student and have no source of income yet.
     
  4. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    7,157
    21,912
    240
    #4 abbodi1406, Jan 10, 2016
    Last edited by a moderator: Apr 20, 2017
    Code:
    @echo off
    %windir%\system32\reg.exe query "HKU\S-1-5-19" 1>nul 2>nul || goto :eof
    setlocal enableextensions
    setLocal EnableDelayedExpansion
    cd /d "%~dp0"
    echo.
    echo Getting Packages Names...
    Dism /English /Online /Get-Packages>Packs.txt
    for /f "tokens=3 delims=: " %%i in ('findstr Package_for_KB Packs.txt') do echo %%i>>PacksNames.txt
    for /f "tokens=3 delims=: " %%i in ('findstr Microsoft-Hyper-V-Integration-Services Packs.txt') do echo %%i>>PacksNames.txt
    for /f "tokens=3 delims=: " %%i in ('findstr Microsoft-Windows-IE Packs.txt') do echo %%i>>PacksNames.txt
    for /f "tokens=3 delims=: " %%i in ('findstr Microsoft-Windows-InternetExplorer-Package-TopLevel Packs.txt') do echo %%i>>PacksNames.txt
    for /f "tokens=3 delims=: " %%i in ('findstr Microsoft-Windows-PlatformUpdate Packs.txt') do echo %%i>>PacksNames.txt
    for /f "tokens=3 delims=: " %%i in ('findstr Microsoft-Windows-RDP Packs.txt') do echo %%i>>PacksNames.txt
    for /f "tokens=3 delims=: " %%i in ('findstr Microsoft-Windows-Security-WindowsActivationTechnologies Packs.txt') do echo %%i>>PacksNames.txt
    for /f "tokens=3 delims=: " %%i in ('findstr Microsoft-Windows-Winhelp Packs.txt') do echo %%i>>PacksNames.txt
    for /f "tokens=3 delims=: " %%i in ('findstr Microsoft-Windows-WinMan Packs.txt') do echo %%i>>PacksNames.txt
    if not exist PacksNames.txt (echo.&echo No visible updates is found&goto :end)
    for /f %%i in (PacksNames.txt) do (
    reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\%%i" /t REG_DWORD /v "Visibility" /d 2 /f >nul
    )
    del PacksNames.txt
    
    :end
    del Packs.txt
    echo.
    echo.
    echo Press any key to Exit
    pause >nul
    goto :eof
    
     
  5. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    6,787
    10,357
    210

    This would take quite a lot of effort and trial/error.
    You would run up against a lot of issues that you simply cannot solve and would need to rethink.
    I'm no expert on the CBS stuff, but I think there's a way to either hide or set updates to permanent.
    I would suggest trying some of the things you see here and asking for more advice when you get stuck.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. ashish.k

    ashish.k MDL Member

    Dec 27, 2014
    204
    99
    10
    #6 ashish.k, Jan 11, 2016
    Last edited by a moderator: Apr 20, 2017
    (OP)
  7. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    6,787
    10,357
    210
  8. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    7,157
    21,912
    240
    just a missing echo , i fixed it
     
  9. ashish.k

    ashish.k MDL Member

    Dec 27, 2014
    204
    99
    10

    Of course Sir, I'm using it in a VM.
     
  10. ashish.k

    ashish.k MDL Member

    Dec 27, 2014
    204
    99
    10
    #10 ashish.k, Jan 28, 2016
    Last edited by a moderator: May 23, 2017
    (OP)
    You can create an ESD for Win7 using WIM<>ESD tool BUT Win7 installation files do NOT support ESD files. So you have to use Win8/8.1/10 installation files instead.

    To do so copy all the installation files of Win8/8.1/10 (any one) and delete install.wim file from "\sources" directory and copy here the install.esd file of Win7 you just created using the tool above. Now finally make ISO file and/or Bootable USB to install Win7.

    Note: Setup will resemble like Win8/8.1/10 but will actually install Win7.

    Regards.
     
  11. greenworld5588

    greenworld5588 MDL Novice

    Jun 4, 2014
    19
    0
    0
    Thank you ashish.k. tested your method, working nice.
     
  12. greenworld5588

    greenworld5588 MDL Novice

    Jun 4, 2014
    19
    0
    0
    I created install.esd of win7 x64/x86 aio install.wim and put it on the place of win8.1 dvd's sources.During installation it give an error about "invalid installation key" & stops the installation.