MSFN Forum: Apply regtweaks (also HKCU) and install apps for ALL users - MSFN Forum

Jump to content


  • 4 Pages +
  • « First
  • 2
  • 3
  • 4
  • You cannot start a new topic
  • You cannot reply to this topic

Apply regtweaks (also HKCU) and install apps for ALL users How to do this just as simple and easy as WinXP? (run RunOnceEx @ T13)

#61 User is offline   mannworld 

  • Group: Members
  • Posts: 1
  • Joined: 08-December 11
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 08 December 2011 - 03:17 AM

Hi ZileXa,

I am trying to add HKCU entries related to "Action Center Settings". These entries are per user entries and I want to make for all users. I tried to add it according to method given below.
Please see my code attached.

<settings pass="auditUser">
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Description>HKCU Entries</Description>
<Order>1</Order>
<Path>CMD.EXE /C C:\AC.cmd</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>

Before capturing WIM file: I copy AC.cmd file(which contains execution of HKCU reg) to C drive. I have even set COPYPROFILE=TRUE. then I run sysprep and capture .WIM file. I don't see HKCU entries after applying this .WIM file. Please help. I am doing all these at least from a month. Please help!!


View PostZileXa, on 18 April 2011 - 03:52 PM, said:

Completely edited this post because I understand it much better now!

1. AutoUnattend.xml will be used first by Windows Setup.
2. By using this command, Setup reboots into Sysprep mode and AutoUnattend.xml is still being used by setup after the reboot
(this was where you lost me, I thought UnattendOOBE.xml kicked in after this reboot, thats not the case):
	<settings pass="oobeSystem">
        <component name="Microsoft-Windows-Deployment">
            <Reseal>
                <Mode>Audit</Mode>
            </Reseal>
        </component>
    </settings>


3. Also, this code is needed to make sure everything that happens after the above mentioned reboot-into-sysprep will be copied to the defaultprofile:
  <settings pass="specialize">
	<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="NonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
	<component name="Microsoft-Windows-Security-Licensing-SLC-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="NonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  	<SkipAutoActivation>true</SkipAutoActivation>
	</component>
	<component name="Microsoft-Windows-Shell-Setup">
 		<CopyProfile>true</CopyProfile
	</component>  
</settings>


4. So Setup has rebooted and is in sysprep state. Setup will now look at settings pass auditUser and perform the commands there (Setup is still reading AutoUnattend.xml):
	<settings pass="auditUser">
  	<component name="Microsoft-Windows-Deployment">
      	<RunSynchronous>
        	<RunSynchronousCommand wcm:action="add">
          	<Order>490</Order>
          	<Path>cmd /c "FOR %i IN (C D E F G H I J K L N M O P Q R S T U V W X Y Z) DO IF EXIST %i:\UnattendedOOBE.xml SETX DVDRoot %i:"</Path>
          	<Description>Set Path For DVD</Description>
        	</RunSynchronousCommand>
        	<RunSynchronousCommand wcm:action="add">
            	<Order>495</Order>
            	<Description>Install apps and HKCU + HKLM regtweaks</Description>
            	<Path>cmd /c %DVDRoot%\InstallAppsTweaks.cmd</Path>
        	</RunSynchronousCommand>
        	<RunSynchronousCommand wcm:action="add">
            	<Order>500</Order>
            	<Description>Reboot into OOBE With Unattend lacking reseal</Description>
            	<Path>C:\Windows\system32\sysprep\sysprep.exe /quiet /oobe /reboot /generalize /unattend:%DVDRoot%\UnattendedOOBE.xml</Path>
        	</RunSynchronousCommand>
      	</RunSynchronous>
  	</component>
  </settings>


5. Note the final command in the code above, Setup will reboot again. After reboot Setup will no longer use AutoUnattend.xml. Instead UnattendedOOBE.xml is used.
UnattendedOOBE.xml is an exact copy of AutoUnattend.xml but it misses the code from step (1) therefore, the code in step (4) is completely ignored.

--> Is this correct?
--> Is it safe to leave the code from step 3 in UnattendedOOBE.xml? Since it's a copy of AutoUnattend minus the code in step (1).
--> I still wonder how and when everything is copied to the default user since you reboot again at the end of step (4), not giving the system any chance to copy everything to the default profile!

(edit: btw I am NOT modifying WIM before I create my ISO image. All the setupfiles/installers of my apps are in %dvdroot%\Apps and I use a .cmd file to install them silently, clean up start menu, copy predefined startmenu, add pins to taskbar/startmenu and run a regtweaks.reg file). So I rebuilding indexes doesnt apply here.)

Please note before replying this post has completely been modified (I tend to read a message in my mail, come to the forum and immediately start my response without noticing changes to the post I am replying to).



#62 User is offline   jhithersay 

  • Group: Members
  • Posts: 2
  • Joined: 14-January 10

Posted 08 December 2011 - 05:30 AM

I have had similar problems running sysprep, especially when using an image created by rt7lite,

I found the problem was that when you use rt7lite to strip items out it left registry entries

In the case of sysprep, there are registry entries at HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\Sysprep

Which were looking for DLL files which were missing from the system.

The workaround was to remove the entries, then sysprep worked.

#63 User is offline   SmokingRope 

  • Newbie
  • Group: Members
  • Posts: 20
  • Joined: 02-July 05

Posted 17 June 2012 - 06:16 AM

I have found that sometimes when running on a virtual machine, setup will fail with the popup like shown below:

View PostZileXa, on 20 April 2011 - 02:50 PM, said:

Once the XML worked... Setup continued but after rebooting into sysprep, input was required! The InstallApps.cmd file was never called. See the screenshot below.
Posted Image


The error happens after running the command:

C:\Windows\system32\sysprep\sysprep.exe /quiet /oobe /reboot /generalize /unattend:%DVDRoot%\UnattendedOOBE.xml


When this command runs, it tries to copy the UnattendedOOBE.xml file to C:\Windows\Panther directory with the name autounattend.xml. For some reason it fails to copy the file.

It seems to ignore the fact that the file failed to copy. It will then try and load the autounattend.xml from C:\Windows\Panther, but it will be the old one instead of the new one. You will also find the old one has been modified during the setup process already, marking it as having already been run.

Because the stages have already been run, sysprep will not execute it again (it would go into an infinite loop of applying registry tweaks / generalizing / rebooting if it did run it again). So instead, it opens the prompt shown in screenshot above.

This same problem does not happen when run on a physical machine, so it may be that it doesn't work in your virtual machine but it does work on phsyical ones.

As a workaround, you can manually copy or hand-edit the unattend file to match UnattendedOOBE.xml and then execute the command again from a command prompt. Setup will complete as normal.

NOTE: I will try and remember to pull the lines from the sysprep.log next time i see this happen and place them here.

#64 User is offline   TheWalrus 

  • N.W.O.
  • PipPipPipPipPip
  • Group: Members
  • Posts: 911
  • Joined: 11-August 08
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 18 June 2012 - 01:47 AM

I would like to see the Action Center settings. I never managed to find any, and I don't think these are saved upon generalizing anyway.

#65 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,750
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 19 June 2012 - 07:42 AM

@SmokingRope
Usually when I go into audit I shutdown sysprep first off CMD /C taskkill /IM sysprep.exe and call it later with command like yours
Are you running something prior to set your %DVDRoot% variable?

@TheWalrus
You mean these? I apply at Firstlogoncommands so that after generalizing

registry removed. use the autoit script below

This post has been edited by maxXPsoft: 23 June 2012 - 08:10 AM


#66 User is offline   TheWalrus 

  • N.W.O.
  • PipPipPipPipPip
  • Group: Members
  • Posts: 911
  • Joined: 11-August 08
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 19 June 2012 - 12:48 PM

Yup, that sort of things. Are there more?

When I configured Action center manually and then generalized and captured the image, those settings did not carry over at all :(



#67 User is offline   The Glimmerman 

  • Member
  • PipPip
  • Group: Members
  • Posts: 138
  • Joined: 03-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 22 June 2012 - 06:12 AM

I have this script that i copy to the startup folder of the default user.

Fine tuning may be needed :)

autoit script

BlockInput(1)
         ActionCenterNotifications()
	_SelfDelete(5)
BlockInput(0)

Func ActionCenterNotifications()
	Dim $HoldReg, $HoldProblem, $UnCheckWindowsUpdate, $UnCheckSpyware, $UnCheckInternet, $UnCheckUAC, $UnCheckFirewall, $UnCheckVirus, $UnCheckBackup, $UnCheckCheckUpdates, $UnCheckTroubleshooting

	$UnCheckWindowsUpdate = 1
	$UnCheckSpyware = 0
	$UnCheckInternet = 0
	$UnCheckUAC = 1
	$UnCheckFirewall = 0
	$UnCheckVirus = 0
	$UnCheckBackup = 1
	$UnCheckCheckUpdates = 1
	$UnCheckTroubleshooting = 1

	If $UnCheckWindowsUpdate+$UnCheckSpyware+$UnCheckInternet+$UnCheckUAC+$UnCheckFirewall+$UnCheckVirus+$UnCheckBackup+$UnCheckCheckUpdates+$UnCheckTroubleshooting <> 0 Then
		Run("rundll32.exe shell32.dll,Control_RunDLL wscui.cpl")
		Sleep(5000)
		Send("+{TAB}") ;shift-tab
		Send("+{TAB}")
		Send("+{TAB}")
		Send("+{TAB}")
		Send("+{TAB}")
		Send("+{TAB}")
		Send("+{TAB}")
		Send("+{TAB}")
		Send("{ENTER}")
		Sleep(500)
		Send("{TAB}")
		If $UnCheckWindowsUpdate Then
			Send("{SPACE}")
		EndIf
		Send("{TAB}")
		If $UnCheckSpyware Then
			Send("{SPACE}")
		EndIf
		Send("{TAB}")
		If $UnCheckInternet Then
			Send("{SPACE}")
		EndIf
		Send("{TAB}")
		If $UnCheckUAC Then
			Send("{SPACE}")
		EndIf
		Send("{TAB}")
		If $UnCheckFirewall Then
			Send("{SPACE}")
		EndIf
		Send("{TAB}")
		If $UnCheckVirus Then
			Send("{SPACE}")
		EndIf
		Send("{TAB}")
		If $UnCheckBackup Then
			Send("{SPACE}")
		EndIf
		Send("{TAB}")
		If $UnCheckCheckUpdates Then
			Send("{SPACE}")
		EndIf
		Send("{TAB}")
		If $UnCheckTroubleshooting Then
			Send("{SPACE}")
		EndIf
		Send("{TAB}")
		Send("{TAB}")
		Send("{TAB}")
		Send("{TAB}")
		Sleep(500)
		Send("{ENTER}")
		Sleep(500)
		Send ("!{F4}" );alt-f4
	EndIf
EndFunc

Func _SelfDelete($iDelay = 0)
		Local $sCmdFile
		FileDelete(@TempDir & "\deleteme.cmd")
		$sCmdFile = 'ping -n ' & $iDelay & '127.0.0.1 > nul' & @CRLF _
				& ':loop' & @CRLF _
				& 'DEL /F /Q "' & @ScriptFullPath & '" > nul' & @CRLF _
				& 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _
				& 'DEL %0'
		FileWrite(@TempDir & "\deleteme.cmd", $sCmdFile)
		Run(@TempDir & "\deleteme.cmd", @TempDir, @SW_HIDE)
EndFunc


This post has been edited by The Glimmerman: 22 June 2012 - 06:13 AM


#68 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,750
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 22 June 2012 - 09:58 AM

View PostThe Glimmerman, on 22 June 2012 - 06:12 AM, said:

I have this script that i copy to the startup folder of the default user.

Fine tuning may be needed :)

That worked great here :thumbup

#69 User is offline   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,395
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 23 June 2012 - 03:59 AM

View PostThe Glimmerman, on 22 June 2012 - 06:12 AM, said:

I have this script that i copy to the startup folder of the default user.

Fine tuning may be needed :)

Thanks for this tip!
I think this AutoIt script works with all languages, isn't it?
Regards

*Edit: Tested and works fine also on Windows 7 French language. And the au3 file is removed at the end of its execution.

This post has been edited by myselfidem: 23 June 2012 - 06:38 AM


#70 User is offline   SmokingRope 

  • Newbie
  • Group: Members
  • Posts: 20
  • Joined: 02-July 05

Posted 01 July 2012 - 08:43 AM

View PostmaxXPsoft, on 19 June 2012 - 07:42 AM, said:

@SmokingRope
Usually when I go into audit I shutdown sysprep first off CMD /C taskkill /IM sysprep.exe and call it later with command like yours
Are you running something prior to set your %DVDRoot% variable?


I'm doing unattended installations using a usb key now. I pull the usb key out as soon as files finish copying so i cant use this DVDROOT tweak. Instead i copy the UnattendedOOBE.xml file into the wim image in a folder C:\Settings\UnattendedOOBE.xml

My commandline actually looks as follows:

C:\Windows\system32\sysprep\sysprep.exe /quiet /oobe /reboot /generalize /unattend:C:\Settings\UnattendedOOBE.xml



I tried to reproduce the error on a Virtual Box virtual machine but installation worked fine. Hopefully i can find some time to try this on VMWare Server 2 next.

Did you include that task kill command because you saw the same errors i was seeing?

This post has been edited by SmokingRope: 01 July 2012 - 08:44 AM


#71 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,750
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 01 July 2012 - 09:25 AM

I just taskkill /IM sysprep when entering Audit because I found sometimes it would just come up and be just a window sitting there. Then my sysprep command line wouldn't work

Quote

My commandline actually looks as follows:
is that in your xml? Then just place taskkill in a command right before

Share this topic:


  • 4 Pages +
  • « First
  • 2
  • 3
  • 4
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy