How to Injet Microsoft .NET Framework 4 into Windows 7 Image

Discussion in 'Windows 7' started by NICK@NUMBER11, Dec 10, 2011.

  1. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,503
    720
    60
    #1 NICK@NUMBER11, Dec 10, 2011
    Last edited: Dec 10, 2011
    Hi all
    I am looking for the correct way to inject the Microsoft .NET Framework 4 as I have done with all the other updates. This is the command that i use, but it ignours the Microsoft .NET Framework 4 exe file..

    Dism.exe /Mount-Wim /WimFile:%~dp0install.wim /Index:1 /MountDir:%~dp0MOUNT
    Dism.exe /image:%~dp0MOUNT /Add-Package /PackagePath:"%~dp0x86"
    Dism.exe /Unmount-Wim /MountDir:%~dp0MOUNT /commit


    Thanks
     
  2. tcntad

    tcntad MDL Guru

    Oct 26, 2009
    4,480
    1,500
    150
    You cant use dism to integrate exe's :p

    Best way and easiest is to use setupcomplete.cmd or sysprep.
     
  3. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,503
    720
    60
    #3 NICK@NUMBER11, Dec 10, 2011
    Last edited: Dec 10, 2011
    (OP)
    Thanks will do that now then...

     
  4. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,503
    720
    60
    #4 NICK@NUMBER11, Dec 10, 2011
    Last edited by a moderator: Apr 20, 2017
    (OP)
    If anyone else wants to do this, here is my setupcomplete.cmd...

    Code:
    @echo off
    for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\sources\install.wim set CDROM=%%i:
    echo Found CD-Rom as drive %CDROM%
    ::Begin hotfix install
    
    REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /V "EnableLUA" /T "REG_DWORD" /D "0" /F
    :NET Framework 4
    echo Installing .NET 4 Framework
    start /wait %CDROM%\updates\dotNetFx40_Full_x86_x64.exe /passive /norestart
    start /wait %CDROM%\updates\NDP40-KB2416472-x86.exe /passive /norestart
    start /wait %CDROM%\updates\NDP40-KB2446708-x86.exe /passive /norestart
    start /wait %windir%\Microsoft.NET\Framework\v4.0.30319\ngen executequeueditems
    
    ::all processing finished, delete used files, and EXIT::
    :CLEANUP
    ::SHUTDOWN /R /T 60
    IF EXIST %windir%\Setup\scripts RD /S /Q %windir%\Setup\scripts >nul
    DEL /F /Q %0% >nul
    exit
     
  5. ricktendo64

    ricktendo64 MDL Expert

    Apr 20, 2008
    1,397
    2,024
    60
    Check my sig you will find a updated slim .net4, you want to have it do ngen executequeditems run it with the /ain switch

    BTW there is a way to get .net4 into your image but it involves sysprep (installing win7, installing .net4, capturing image), my sig also has links to videos describing this but I have to re-upload them
     
  6. Dre009

    Dre009 MDL Addicted

    Oct 26, 2009
    602
    233
    30
    @NICK@NUMBER11

    Think you should put the coding in code tags, as the word "current" as a space in between.
     
  7. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,503
    720
    60
    #7 NICK@NUMBER11, Dec 10, 2011
    Last edited: Dec 10, 2011
    (OP)
    Thanks dre022392, done as requested

    No here is a question do i need to call setupcomplete.cmd from somewhere?

     
  8. ricktendo64

    ricktendo64 MDL Expert

    Apr 20, 2008
    1,397
    2,024
    60
    No you dont, if you have it in the right dir it will automatically be executed
     
  9. Stannieman

    Stannieman MDL Guru

    Sep 4, 2009
    2,232
    1,818
    90
    Why couln't MS just follow the standard MSU and cab layout all updates and SPs have?
    It would make it possible to dism it.
    The changes made by the .net framework install are less drastic then those of an SP install, and even an SP can be dismed with a little efford...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,503
    720
    60
    #10 NICK@NUMBER11, Dec 12, 2011
    Last edited by a moderator: Apr 20, 2017
    (OP)
  11. kalmly

    kalmly MDL Novice

    Oct 15, 2009
    6
    1
    0
    heads up! noob here,,, what about the updates that requires genuine windows, will these install fine via setupcomplete.cmd if i left the activation part of windows untouched at this point? ...
     
  12. anarchist9027

    anarchist9027 MDL Expert

    Oct 30, 2010
    1,320
    667
    60
    #12 anarchist9027, Sep 15, 2012
    Last edited: Sep 15, 2012
    Just a heads up, instead of just installing .net 4.0 with the setupcomplete.cmd,, you can replace the .Net 4.0 installer with the full .Net 4.5 installer. It installs all prior .Net 4 security updates along with .Net 4.0 & .Net 4.5. Saves alot of time and alot unneeded updates
     
  13. Simpuhl

    Simpuhl MDL Senior Member

    Aug 8, 2012
    395
    42
    10
    We still waiting on a 4.5 slim :) <3
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. kalmly

    kalmly MDL Novice

    Oct 15, 2009
    6
    1
    0
    so the path to the loader is :Windows\Windows Loader\Windows Loader.exe?
    doz your setupcomplete do a cleanup?
    lastly how much time do we have to install apps etc. with setupcomplete before install freezes lol? :eek:
     
  15. anarchist9027

    anarchist9027 MDL Expert

    Oct 30, 2010
    1,320
    667
    60
    Yes, I have my WindowsLoader.exe in its own folder with everything that is included in the original zip and yes, the cleanup is at the end of the script. As far as updates to the setupcomplete.cmd goes, setup should not freeze at all