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

Jump to content


  • 4 Pages +
  • 1
  • 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)

#21 User is offline   fragbert 

  • Junior
  • Pip
  • Group: Members
  • Posts: 61
  • Joined: 01-November 05

Posted 17 March 2011 - 08:06 PM

AddonKopierer
http://win-lite.de/w...0-0-4-0-7-beta/


Its a german addon integrator for Win7 that is roughly translated in English but does EXACTLY what you require.

I too am very much in your shoes in that I was deeply embedded in the methods of tailoring an unattended XP installation source, and as we all know, the movent lost a TON of steam since vista and still takes a lot of digging to get to the same functionality for Win7 UA installs.

Perhaps I'm lazy and just am in a permanent state of TL;DR - but to hell with mounting WIMs in and every darn time just add an app! BAH!

This little critter inserts addons to your install source in a separate addon folder, which you can then easily replace switchless installers with the latest ones (use the same exe name). My question is how do you do this process manually? I probably waited years for a utility like this...


#22 User is offline   neuropass 

  • Member
  • PipPip
  • Group: Members
  • Posts: 127
  • Joined: 09-September 08
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 18 March 2011 - 09:07 PM

If you enable the Administrator account with the autounattended.xml the regtweaks are applied without any fuss or workaround.

#23 User is offline   maxXPsoft 

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

Posted 19 March 2011 - 06:33 AM

Loading Admin will only apply HKCU to him only.

You have to load a user to apply User tweaks. OK :yes: That is why it is called HKEY_CURRENT_USER

You cannot apply HKCU except
1. mounting image and applying to defaults.dat. I found some I wanted would not apply doing that so went back to #2
2. use a reg file during Firstlogoncommands and these are applied before desktop loads
3. Run a script for each user which he said he was going to do

I am sure there are a couple more way's with policies but even those don't get all I want and other such but #2 is easiest for me.

This post has been edited by maxXPsoft: 19 March 2011 - 06:34 AM


#24 User is offline   Major 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 306
  • Joined: 30-January 05

Posted 27 March 2011 - 02:07 PM

@maxXPsoft
the Firstlogoncommands is for all the users and the future users or only for the current user who you have done the unattended installation.

#25 User is offline   maxXPsoft 

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

Posted 27 March 2011 - 03:06 PM

View PostMajor, on 27 March 2011 - 02:07 PM, said:

@maxXPsoft
the Firstlogoncommands is for all the users and the future users or only for the current user who you have done the unattended installation.

Yes that is why I said #2 works best for me. Have been doing this since first Vista beta.
The FirstLogonCommands setting specifies commands to run the first time a user logs on to the computer. These commands run only once.

This post has been edited by maxXPsoft: 27 March 2011 - 03:12 PM


#26 User is offline   neuropass 

  • Member
  • PipPip
  • Group: Members
  • Posts: 127
  • Joined: 09-September 08
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 30 March 2011 - 08:59 PM

View PostmaxXPsoft, on 19 March 2011 - 06:33 AM, said:

Loading Admin will only apply HKCU to him only.



That was Exactly my point . Why would you use an account with lower privileges when you can use the 'Hidden Admin' with the highest Privileges?

#27 User is offline   maxXPsoft 

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

Posted 31 March 2011 - 06:58 PM

View Postneuropass, on 30 March 2011 - 08:59 PM, said:

That was Exactly my point . Why would you use an account with lower privileges when you can use the 'Hidden Admin' with the highest Privileges?

Not everybody going to run as built in Administrator and the majority should not.

try to merge this reg file. Administrator account can't even merge this without setting permissions. Do you feel less powerful now? :whistle:
[HKEY_CLASSES_ROOT\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder]
"Attributes"=dword:a9400100
; Default is a0900100


TrustedInstaller has full permissions on that but Administrators group which Administrator belongs to does not
with UAC off I can do anything the Administrator can do.

#28 User is offline   SmokingRope 

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

Posted 04 April 2011 - 12:09 AM

I am installing regtweaks during setup on my unattended usb key. Most of my information for doing this came from the FireGier guide for vista.

To summarize,

You will need two copies of your unattended file, these two files only need to differ by one setting. AutoUnattend.xml will have this line, second file (UnattendedOOBE.xml for remainder of this discussion) does not have this setting. I usually setup autounattend.xml and as a last step before copying to usb key create the UnattendedOOBE.xml from the autounattend.xml

    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Deployment">
            <Reseal>
                <Mode>Audit</Mode>
            </Reseal>
        </component>
    </settings>



This will cause setup to boot into sysprep mode.

You need to put a command to run during auditUser that will , generalize, capture the image, reboot the system back into OOBE and have it use UnattendedOOBE.xml config instead of autounattend.xml. This needs to be the very last command executed (as the system reboots afterwards).

    <settings pass="auditUser">
        <component name="Microsoft-Windows-Deployment">
            <RunSynchronous>
                <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>



During sysprep mode, system will be running as administrative user, to make those settings apply to the default user profile you need to put a setting into specialize pass

    <settings pass="specialize">
        <component name="Microsoft-Windows-Shell-Setup">
            <CopyProfile>true</CopyProfile>
        </component>
    </settings>



To get the %DVDRoot% I just search the drive letters looking for the UnattendedOOBE.xml file in the root directory: (I run this command both in auditUser and specialize passes but i'm not sure whether that's really necessary)

                <RunSynchronousCommand wcm:action="add">
                    <Order>497</Order>
                    <Path>cmd /c &quot;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: -m&quot;</Path>
                    <Description>Set Path For DVD</Description>
                </RunSynchronousCommand>




Other things to note:

  • After making changes to the wim (e.g after mount / unmount commit) files, you need to open it up in WSIM and let it rebuild the indexes or whatever, it feels a lot like black-magic but this has fixed several of my problems with rebooting the system using UnattendedOOBE.xml
  • Registry tweaks are applied through .reg files during auditUser pass running command: REGEDIT /s C:\MyRegistryTweaks.reg
  • Installing apps during auditUser means those apps are available to any account in the system...


Hopefully i captured all the relevant steps here, you can refer to the firegeier guide if you run into any issues though.

#29 User is offline   maxXPsoft 

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

Posted 04 April 2011 - 06:45 AM

OP didn't want to do Audit Mode or I would have mentioned that CopyProfile

Quote

Important:
The built-in administrator account profile is deleted and recreated when you perform a clean Windows installation, or run the Sysprep tool. The CopyProfile setting is processed before the built-in administrator account is deleted, so any customizations that you make should appear in new user account profiles, including the new built-in administrator account profile.


#30 User is offline   SmokingRope 

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

Posted 06 April 2011 - 07:30 PM

Quote

Now 2 weeks later I would like to replace Firefox in my uA_Win7 setupdvd with the newest Firefox 4 final. I would have to capture a new image right?

I want to be able to just replace the FF4 beta installer with the FF4 final installer. Done, finished, nothing extras. Not even modify the batch file or xml that executes the installers or whatever since all I have to do is make sure the setup filename is still the same.
This is the way I could do it for winXP and I'm looking for a similar method for Win7. Without having to create a personalized image to capture everytime I want to update my Win7 setup DVD.


I got the impression he believed audit mode was a manual process as is suggested by most of the tutorials on tech republic. Using copy profile as described, audit mode is applied inline during installation and is completely unattended. You can throw your apps on your dvd / usb stick and install your apps directly from there without changing the unattended process at all.

It is the equivalent of the old windows XP procedure.

This post has been edited by SmokingRope: 06 April 2011 - 07:32 PM


#31 User is offline   Major 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 306
  • Joined: 30-January 05

Posted 07 April 2011 - 04:06 AM

So the command have you told, you must write in the file UnattendedOOBE.xml or Autonunattend.xml? because i have tried the sysprep at the first of my unattended but i had never got that HKCU are been applied to all the user and the future users also, then i have used the other method setupcomplete.cmd which it works perfectly. Neverthless i will try the method sysprep as i want to learn how it works.
      
  <settings pass="specialize"> 
        <component name="Microsoft-Windows-Shell-Setup"> 
            <CopyProfile>true</CopyProfile> 
        </component> 
    </settings>

This post has been edited by Major: 07 April 2011 - 04:10 AM


#32 User is offline   RickSteele 

  • Rick Steele
  • PipPip
  • Group: Members
  • Posts: 259
  • Joined: 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 07 April 2011 - 04:42 PM

Came across this M$ URL and thought some may find it helpful:

http://technet.micro...318(WS.10).aspx

#33 User is offline   ZileXa 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 767
  • Joined: 27-May 04

Posted 09 April 2011 - 07:05 AM

Hi SmokingRope, I have questions about it. Hope you can clarify the process for me.
I have 1 unattend.xml and I install my software via setupcomplete.cmd (because Office 2010 x64 and Paint.net cannot be installed earlier, they will fail).

If I understand your process correct, it should go like this:

1. Windows setup starts with AutoUnattend.xml. This file contains the settingspass OobeSystem + settingspass auditUser + settings pass Specialise lines from your post. Setup will boot into sysprep.

2. in sysprep, what happens now? Is input from the user required?
I think this is what I should do: add a command to auditUser that will run my regtweaks, install apps, cleanup startmenu. This command should run first, your auditUser command to generalize should run last.
Is this correct?

3. after your auditUser command has run, system will reboot again and continue normally using the 2nd xml file. this file does NOT contain your Oobesystem/audituser/specialise lines. Is this Correct?

4. I do not understand how your note about "changes to WIM" is related to the process. I am not changing WIM or anything. I just want to apply my regtweaks for all users.

#34 User is offline   SmokingRope 

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

Posted 10 April 2011 - 10:39 AM

The order the passes run is something like:

1) windows PE
2) oobeSystem (reboot here)
3) specialize
4) audit user (reboot here - from last command)
5) oobeSystem again with UnattendedOOBE.xml

During auditUser the environment is setup, and programs can run just like they would after setup is finished. Input *could* be provided during auditUser pass but if you set up command-lines right then no input is necessary.

You just have to remove a few lines from UnattendedOOBE.xml (the reseal part) - process reboots from auditUser directly into OOBESystem step so it doesn't matter what you have in the other passes.

            <Reseal>
                <Mode>Audit</Mode>
            </Reseal>



As for the note about the WIM, i can't say that it will affect you but it has caused a lot of headaches for me while doing this. I always slipstream hotfixes and put the applications i am installing in the WIM and if you don't rebuild the index (or whatever it's called, haven't done it recently) then during setup, sysPrep fails to load the UnattendedOOBE.xml and you end up having to click through the boxes in step #5 above and registry settings are not applied because *generalize* didn't take place. It takes an hour to get to this point inside a virtual machine so it's a pain to debug / test (I probably have wasted days on the issue). The actual solution was found serendipitously and the only thing i know is that it seems to work.

EDIT:
Rebuilding the WIM: it might be helpful to grab the error codes from the UnattendedGC.log / Panther.log files and put them in this thread somewhere for search engines to pickup. Will see about doing this if I have time.

This post has been edited by SmokingRope: 10 April 2011 - 10:45 AM


#35 User is offline   maxXPsoft 

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

Posted 10 April 2011 - 09:56 PM

View PostSmokingRope, on 10 April 2011 - 10:39 AM, said:

The order the passes run is something like:

1) windows PE
2) oobeSystem (reboot here)
3) specialize
4) audit user (reboot here - from last command)
5) oobeSystem again with UnattendedOOBE.xml

where did you get that? I suggest you look at unattend.chm
depending on what you have added
Attached File  passes.PNG (19.17K)
Number of downloads: 7

#36 User is offline   marcusj0015 

  • Member
  • PipPip
  • Group: Members
  • Posts: 154
  • Joined: 05-July 09

Posted 15 April 2011 - 12:08 PM

why in the hell are you making a whole new disc every other WEEK?

what you need to do is put a folder called like Apps, inside your image, with the program installers, and use SetupComplete.CMD, to install the exe's

#37 User is offline   maxXPsoft 

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

Posted 16 April 2011 - 04:42 AM

Quote

sources\$OEM$\$$\SETUP\Scripts\Setupcomplete.cmd Setupcomplete.cmd runs right before Load Desktop and can be used to complete Final Steps. Commands in the Setupcomplete.cmd file are executed with local system privilege.
HKLM Reg tweaks can be ran here but not HKCU which are user specific.

Try running Windows Calendar(WinCal-Win7-amd64-en-us.exe) or WinPinball-en-us.exe in setupcomplete and they fail. Why? Because a user is not yet created. That run's right before Login screen. Why do I set login? To observe when things are actually happening I get a better picture.
I will try those in Firstlogoncommands next but that starts after you login and GUI is loading = User Created

#38 User is offline   ZileXa 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 767
  • Joined: 27-May 04

Posted 18 April 2011 - 03:23 PM

Actually, I just ran another test and I am asked to create a user before setupcomplete.cmd is executed. It is executed after creating a user account but before that user logs in.

Since I now finally have a stable stripped down Win7 x64 Ultimate image without WinSxS I am going to test SmokingRope's method :) Will report later.

This post has been edited by ZileXa: 18 April 2011 - 03:23 PM


#39 User is offline   ZileXa 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 767
  • Joined: 27-May 04

Posted 18 April 2011 - 03:52 PM

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).

This post has been edited by ZileXa: 18 April 2011 - 04:49 PM


#40 User is offline   SmokingRope 

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

Posted 19 April 2011 - 05:12 PM

Zilexa - it sounds like you know as much as I do about this now. As far as i am aware it is safe to keep the auditUser / specialize / windowsPE passes in UnattendedOOBE.xml - i think it's equally safe to remove them.

This post has been edited by SmokingRope: 19 April 2011 - 05:16 PM


Share this topic:


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

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



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