ZileXa

Apply regtweaks (also HKCU) and install apps for ALL users

71 posts in this topic

if you want to skip reading, go to post #39 were the current subject of this topic starts.

From 2004 till 2007 or so, I've been very active on the whole unattended thing, slimming down XP while maintaining all consumer related functionality. Installing lots of apps automatically, creating silent installers, autoit stuff. I wanted a disc that was easily updated (for example, just copy the latest firefoxsetup.exe to the InstallApps folder).

Now I am going to switch to Win7, I want to do the same. I do not want to create a WIM image first!! Because I want to be able to just drop new version of installers (Office, Firefox, Java etc) in a folder in the root of the win7setup disc and burn that to a dvd or USB to have a new version of my Win7_uA.

With XP it was simple, create a RunOnceEx.cmd file with all the paths to the installers with silent commands to add to the registry. Call a cleanup.cmd file and a regtweaks.reg file. They will all be executed when RunOnceEx is executed, by using a special command you could run RunOnceEx at the same time the cmd file was executed wich was called early setup stage T13, before firstlogon. You could even add reboots.

This was soo easy! all settings and apps would be applied for all future created users.

Also, I want to add a few regtweaks to the registry before users are created, the most important regtweak is the one that has the location of the C:\Users folder, with a regtweak I want to change this to D:\ (thats also one reason why this tweak should be applied before users are created).

After searching I've learned about Setupcomplete.cmd but lots of people report issues about not all commands being executed. Google is full of bad stories about this method.

Then there is Synchronous commands at Firstlogon. But I want my apps and regtweaks to be installed/applied for all users, also the ones created in the future. So this won't work.

Anyone willing to share their thoughts?

Edited by ZileXa
0

Share this post


Link to post
Share on other sites

You have to install windows 7, boot into sysprep mode, install apps, add regtweaks, generalize, capture the image, then in autounattend.xml you have to use CopyProfile so the settings overwrite the Default User's settings

Hope to make a vid in the next few weeks on preinstalling apps, for the time being here is a link on how to do a reverse integration of vista that is pretty much the same deal

http://blogs.techrepublic.com.com/window-on-windows/?p=1249

Edited by ricktendo64
0

Share this post


Link to post
Share on other sites

From what I've read about this method, it's exactly what I do not want...

What if I do exactly what you say, install stuff like Firefox, Office, java, Flash, Photoshop and whatever.

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.

Edited by ZileXa
0

Share this post


Link to post
Share on other sites

Correct, you would have to re-image...thats why I dont add much, all I add are DirectX, Silverlight, dotNET4, MsSecEs, PlayReady, Office 2k10, all vc rutimes and maybe flash, java, shockwave (the rest I install via WPI)...I also tweak Windows how I want it, start menu, recycle bin, hidden files/folders, services, the ussual stuff, I also apply my hkcu regtweaks and whatnot

There are several programs like win7toolkit and dx integrator that have addon support, I dunno if those programs you mention have been made into addons but you can probably request them

Edited by ricktendo64
0

Share this post


Link to post
Share on other sites

I definitely do not want to depend on people making addons for me, just want to use the normal setup files for any software I want to add.

Surely there must be an easy way to do this... I'm still messing around with 0ffice2010 when thats finished I'll test setupcomplete.cmd...

0

Share this post


Link to post
Share on other sites

Just my 2cent as i am not a Win7 specialist: i would prep a modded wim from the Win7 install CD and add a runonce key as you did before or (if doesn't work) install a service (with instsrv and srvany ) that would do it. Both of them would start a batch ( or another kind of script as you wish ) and list in a folder all subfolders and then for each folder exec another script that would be the silent install of the application (and if it was launched with the added service, remove it) .

0

Share this post


Link to post
Share on other sites

I definitely do not want to depend on people making addons for me, just want to use the normal setup files for any software I want to add.

Surely there must be an easy way to do this... I'm still messing around with 0ffice2010 when thats finished I'll test setupcomplete.cmd...

win7toolkit has an addon maker, you wont do office but it can handle firefox and stuff...win7toolkit addons copies the files into the mounted image and mounts and then mounts/adds the program registry settings

0

Share this post


Link to post
Share on other sites

I do it this way where my APPS folder is on another drive.

Then if I update any application it picks up from there like you said if name was same and since I use simple autoit where it makes that even easier

$search = FileFindFirstFile ( @ScriptDir & "\Firefox Setup 3*.exe" ); Search distribution

0

Share this post


Link to post
Share on other sites

I do it this way where my APPS folder is on another drive.

Then if I update any application it picks up from there like you said if name was same and since I use simple autoit where it makes that even easier

$search = FileFindFirstFile ( @ScriptDir & "\Firefox Setup 3*.exe" ); Search distribution

I just use a dedicated USB stick for my ua windows 7+apps. So all the apps will be on the stick in an APPS folder.

I'm going to test runonce and setupcomplete. Unfortunately my harddisk containing all my important stuff isnt working anymore so I have to figure out a way to save that data before I continue this project.

EDIT:

The most important thing for me is to apply regtweaks during install that will apply for all users created in the future...

Edited by ZileXa
0

Share this post


Link to post
Share on other sites

The following batch will load your wim, then the wim registry hives, apply reg tweaks, save and unload both, or, remark the mount/unmount commands, load the wim in DISM, merge your custom files, do whatever else and dismount with DISM. You wil have to change the paths to your wims and OPK tools. Also, you may choose to name your wim hives something other than WIM_Default....etc.-no spaces, but, the names of the branches in your custom files must match the names you apply to the wim hives when you mount them.

The legend is:

(HKEY_CLASSES_ROOT)
HKEY_LOCAL_MACHINE\WIM_Software\Classes

(HKEY_CURRENT_USER)
HKEY_LOCAL_MACHINE\WIM_Default

(HKEY_LOCAL_MACHINE\SOFTWARE)
HKEY_LOCAL_MACHINE\WIM_Software

(HKEY_LOCAL_MACHINE\SYSTEM)
HKEY_LOCAL_MACHINE\WIM_System

The remarked entries are self explanatory:

CLS

@echo off

REM "C:\Program Files\WindowsResources\Windows AIK\Tools\amd64\Servicing\Dism.exe" /mount-wim /wimfile:"D:\GRMCULXFREO_EN\sources\install.wim" /index:4 /mountdir:"D:\DISM_Folders\mount"

pause

reg.exe load HKEY_LOCAL_MACHINE\WIM_Default "D:\DISM_Folders\mount\Users\Default\NTUSER.DAT"
reg.exe load HKEY_LOCAL_MACHINE\WIM_Software "D:\DISM_Folders\mount\Windows\System32\config\SOFTWARE"
reg.exe load HKEY_LOCAL_MACHINE\WIM_System "D:\DISM_Folders\mount\Windows\System32\config\SYSTEM"

pause

REM reg.exe import "D:\DISM_Folders\DISM_Temp\GRMCULXFREO_EN\ServicesTemplate.reg"

REM pause

REM reg.exe import "D:\DISM_Folders\DISM_Temp\GRMCULXFREO_EN\ContextMenu.reg"

REM pause

REM reg.exe import "D:\DISM_Folders\DISM_Temp\GRMCULXFREO_EN\RegistryTweaks.reg"

REM pause

REM reg.exe import "D:\DISM_Folders\DISM_Temp\GRMCULXFREO_EN\GroupPolicyRegistry.reg"

REM pause

reg.exe unload HKEY_LOCAL_MACHINE\WIM_Default
reg.exe unload HKEY_LOCAL_MACHINE\WIM_Software
reg.exe unload HKEY_LOCAL_MACHINE\WIM_System

pause

REM "C:\Program Files\WindowsResources\Windows AIK\Tools\amd64\Servicing\Dism.exe" /unmount-wim /mountdir:"D:\DISM_Folders\mount" /commit
REM "C:\Program Files\WindowsResources\Windows AIK\Tools\amd64\Servicing\Dism.exe" /unmount-wim /mountdir:"D:\DISM_Folders\mount" /discard
REM "C:\Program Files\[size="2"]WindowsResources[/size]\Windows AIK\Tools\amd64\oscdimg.exe" -u2 -m -o -lGRMCULXFREO_EN_DVD -b"D:\DISM_Folders\DISM_Temp\etfsboot.com" -yo"D:\DISM_Folders\DISM_Temp\bootorder.txt" "D:\GRMCULXFREO_EN" "C:\GRMCULXFREO_EN_DVD.iso"
REM "C:\Program Files\WindowsResources\Windows AIK\Tools\amd64\oscdimg.exe" -u2 -m -o -lGRMCULXFREO_EN_DVD -b"D:\DISM_Folders\DISM_Temp\etfsboot.com" -yo"D:\DISM_Folders\DISM_Temp\bootorder.txt" "D:\GRMCULXFREO_EN_DVD" "C:\GRMCULXFREO_EN_DVD.iso"

REM pause

EXIT

Edited by RickSteele
0

Share this post


Link to post
Share on other sites

I was actually looking for a method to apply regtweaks.reg during windows setup, using either autounattend.xml or a different method.

I have tried the following commands at various stages, using autounattend pass Specialize and FirstLogonCommands and SetupComplete, but NONE applied the HKCU regtweaks for all users created.


:: first attempt
::==========
START /wait regedit.exe /s %SETUPDRIVE%\Regtweaks.reg

:: second attempt
:: Load the default profile hive
START /wait REG LOAD HKU\DefaultUser C:\Users\Default\NTUSER.DAT

:: Configure the default user profile (try two different methods)
START /wait REG IMPORT %SETUPDRIVE%\Regtweaks.reg
START /wait regedit.exe /s %SETUPDRIVE%\Regtweaks.reg

:: Unload the default profile hive
START /wait REG UNLOAD HKU\DefaultUser

I wanted to do this without using OPK Tools... but it seems I have no other option. I think it's weird that we cannot just apply regfiles before the first user logs on and apply it for all users created in the future. This was perfectly possible with WinXP.

It seems loading wim is the only reliable way to go, I'll try the above script.

O WAIT! I have even imported my regtweaks file in RTSevenLite! wich also applies the tweak to the wim source! Still they are not being applied. So either RT7lite is buggy or this method is also not working.

0

Share this post


Link to post
Share on other sites

To install OPK tools, I have to enroll into something... I get to see a " Enrolling in the Microsoft Partner Network" website...

Why would all of this be necessary (hell why download 2 GB opktools to install Win7 x64 wich is not even 2GB!?) just to apply regtweaks for all users.

0

Share this post


Link to post
Share on other sites

To install OPK tools, I have to enroll into something... I get to see a " Enrolling in the Microsoft Partner Network" website...

Why would all of this be necessary (hell why download 2 GB opktools to install Win7 x64 wich is not even 2GB!?) just to apply regtweaks for all users.

You dont need OPK to do what he is suggesting, WAIK can do it

BTW OPK and WAIK are almost identical

Edited by ricktendo64
0

Share this post


Link to post
Share on other sites

Ricksteele posted the easiest way to add HKCU to default. Mount the wim and apply

The only place HKCU reg tweaks work is during oobe and after a user is created.

0

Share this post


Link to post
Share on other sites

I already tried his method by running this cmd file after RT 7lite loads the image (this way I don't have to register as an OEM and download 2GB OPKTools):

reg load hklm\temp1 %temp%\rt_mount\users\administrator\ntuser.dat
reg load hklm\temp2 %temp%\rt_mount\windows\system32\config\software

pause

reg.exe import "D:\downloads\RegTweaks.reg"

pause

reg.exe unload hklm\temp1
reg.exe unload hklm\temp2

PAUSE

This script runs flawlessly, but when I install windows and check the tweaks, they have not been applied for hkcu. I don't know why Ricksteele reported success, since I can clearly see the HKCU tweaks did not apply.

What I am doing now is dirty but works partially:

create a shortcut inside the Default users Start Menu (after Rt 7 lite has loaded the image: %temp%\rt_mount\users\default) inside the Startup subfolder of the startmenu.

This shortcut launches a cmd file that I will place inside C:\Users.

This cmd file cleans up the current users start menu and desktop and runs the regtweaks.reg file, at the end it deletes the shortcut in the startmenu of the current user (not the default user).

This way, every user created in the future will have a shortcut that will call this batchfile.

I said it works partially because:

  1. I use HKCU regtweaks to place Desktop, My docs, My music, My Downloads, My Pictures, My Videos in D:\%username%.
  2. And I use HKLM regtweaks to place Public Music, Public Downloads, Public Pictures and Public Videos in D:\.

For #2 everything goes fine. the public folders are located on D:\ after Windows Setup.

For #1, the regtweaks will be applied (via start menu Startup) after those folders have been created already on the C:\Users\%Username%. So I have to reboot again after first login to see the changes. And even after reboot I do see the D:\%username% folder, but it only contains My documents and Desktop (My Pictures, My Downloads, My Music etc is missing).

So I still have to find a fix for this.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.