JIT Setup - really nice feature and most people dont know about it!

Well, when I talked with Noise in discussion under one of my previous posts, I decided I will write something about this feature. It is called Active Setup.

When new user logged on first time, their profile is created from Default user and ntuser.dat from default user... However there are some things that you cant find in default user - for example icons for Outlook Express. Most administrators dont want to have these icons - mostly because they are using more robust email client like outlook.

Most of these administrators just left them where they are. However how are these icons created?

When you look to HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components, you will see a pack of GUIDs -

every GUID here means what to do when new profile is created. The most important value is StubPath - it is path to command to execute. When this is not available, it will just ignore it.

Lets try small experiment - first locate key {6BF52A52-394A-11d3-B153-00C04F79FAA6} - it is key responsible for creating WMP icon. When you change the name of StubPath (for example DisableStubPath), the icons wont create. Neat, right? :)

Now you know how to disable certain components - however there is of course another use for them - you can create new!

For example you have application, that is using per-user settings. You want to specify default settings and you cant use HKLM\All users.

If you dont know how to create GUID, you can use my script:

strGuid = Left(CreateObject("Scriptlet.TypeLib").Guid, 38)
strInterpreter = Wscript.FullName
strInterpreter = InStr(strInterpreter,"cscript")
If strInterpreter = 0 Then
 InputBox "Generated GUID:", "GUID Generator", strGuid
Else
 Wscript.Echo strGUID
End If

  1. create new key containing GUID.
  2. create file test.cmd with content “mkdir c:\test“ in c:\temp
  3. create value StubPath with path to your script, that will create this settings. In our example it will be “C:\Temp\test.cmd“
  4. create value ComponentID with any name you prefer. For example “Test active setup“
  5. Last needed value is IsInstalled. It should be REG_DWORD with value 1.

Now try to log as new user... Is it working? :)

Published Thu, Oct 6 2005 14:54 by martin
Filed under: ,

Comments

# re: JIT Setup - really nice feature and most people dont know about it!

OK Martin, I don't know if you have experimented much with this, but I have a few questions. It's complicated so I will try and make it as simple as possible.

Lets say you have an XP PC that has been used for a while. Three _local_ accounts have already been created on it. Lets say these accounts are called User1, User2 and Administrator. Using the JIT installer method you described, you install the test.cmd file using the Administrator account.

Question1: Will the test.cmd run when User1 and User2 log on? Remember, these accounts already existed before you installed the JIT setup. They don't use the default user profile.

Question2: If a new user (User3) logs into the system, will the test.cmd run?

Question3: Lets say User2 does not have Admin level rights on the system. If/when test.cmd runs will it run with elevated privileges?

Question4: Does the test.cmd file run only once, or does it execute every time the user logs on?

What I'm looking for here is to see if the active setup JIT installation method will handle both pre-existing and new profiles. This would be a very good thing. Because the default user method of controlling profiles only handles new user accounts, not accounts that are already present on the system.

Monday, October 10, 2005 6:00 PM by martin

# re: JIT Setup - really nice feature and most people dont know about it!

Hey Noise, I got really cool news for you :)

1.) YES - it will run one-time per user...

2.) YES :)

3.) YES :) Just tested it, because I was personally not sure - I created test.cmd that will create directory in %WinDir% and it worked without problem under common user

4.) Nope, it is only once per user - something like RunOnceUser :D

Tuesday, October 11, 2005 11:33 AM by martin

# re: JIT Setup - really nice feature and most people dont know about it!

This is the best thing I've seen in a long time. It's absolutely perfect!

Now I can install an application like Adobe Reader, and include per-user settings that will get incorporated in every profile, both existing profiles and newly created ones.

Oooo I got shivers :) - Thanks Martin

Tuesday, October 11, 2005 5:21 PM by martin

# re: JIT Setup - really nice feature and most people dont know about it!

Martin,

I renamed the stubpath of Windows Media Player's GUID and rebooted. Logged on as a new user and I still receive the Windows Media Player on my Desktop.

Best Regards,
Brian Smith

Friday, March 17, 2006 5:59 PM by Brian Smith

# re: JIT Setup - really nice feature and most people dont know about it!

Hey Brian!

it should work... isnt there icon in All Users or Default user?

Martin

Monday, March 27, 2006 6:50 AM by martin

# re: JIT Setup - really nice feature and most people dont know about it!

Just a warning, from my testing return codes appear to be ignored, that is the command will run once whether or not it succeeded.

Bye

Dennis

Monday, January 01, 2007 11:40 PM by Dennis Bareis