Deployment Solution

 View Only

Packaging Tricks: Deployment of Registry Keys 

Mar 06, 2009 02:06 PM

Registry Keys: Deployment (Method 1)

Below is the method I use to install registry keys. In this example I will be changing the setting that advertises custom text at the top of the internet explorer browser.

 

  • On the test/packaging machine, open your registry editor ( Start > Run > Regedit )

 

 

  • Locate the registry key you want to export & edit the setting to your desired text.

 

 

  • Export the registry key (In this case Main). You can do this by Right clicking the tree item, and then clicking. I generally save (under an appropriate & identifiable name) on the desktop and move later after I’ve edited it.

 

 

  • Now you’ll need to edit this key so you only export the setting you want. So on your newly saved registry key, “right click”, then “edit”.

 

 

  • Remove all the text so you are left simply with the line(s) you need. Leave the version info at the top. It should look something like this;

 

 

  • Now you’ve got what you need, save the file and move to an appropriate folder. I have mine saved on the express share so I can find all my various bits and bobs easy. You don’t have to do this, but it’s easy to back things up if it’s all together. For the rest of this guide I’ll be using this location; <em>\\dsserver\eXpress\Jobs\RegistryKeys</em>

 

  • In the deployment console, create a new job and name it.

 

  • Add to this a new “Copy File To...” task, and link it to your registry file. For the destination path, enter “C:\Windows\Temp\registry.reg”

This will copy your file to that location and rename the file to registry.reg.

 

 

  • Add another task. This time a “Run Script” task. Enter the below text into that page.

REM Install Registry Key
Regedit.exe /s “C:\Windows\Temp\Registry.reg”
-- REM is just a remark, so doesn’t do anything, but it will give you a description of the script.
-- Regedit /s will run the import command silently. This will not give the user any prompts.

 

  • Now. The final task you add to that job is to clean up behind yourself. Obviously something that should be done to prolong the life of the computers you manage. I generally believe its best practice to leave no excess crap or traces you were there on any machines.

So... New task, “Run Script”.
REM Cleanup Temporary Files
del /q "C:\Windows\Temp\registry.reg"So I’m using a simple dos command (Del). The /q switch is Quiet mode, so it will not give a Yes/No prompt before deleting.

 

 

NOTES:

  • Before you put this job out into production you need to test it. So drag & drop it to a fresh test machine. Then (in this case) open internet explorer and see if your settings has taken effect.

 

  • Create a template folder in your jobs tree-view. Copy this job into that template folder. This way you can just copy it and link it to a new registry key when importing other keys to a machine

 

  • When uninstalling a registry key use the – symbol in the following ways.

To uninstall a tree item mark here;

[-HKEY_CURRENT_USER\Software\RemoveItem] – This will delete “RemoveItem”and anything below it. Be careful

To uninstall a single entry use the – after the equals symbol.

"RegistryEntry"=-

Statistics
0 Favorited
2 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Mar 07, 2009 05:44 AM

Yes. I understand that "Current user" would be a problem. I could probably have used a better registry change for the example instead of a personal customisation. I agree with the VB being a better method, but if you don't know any. This will work for you as far as global changes (and in my experience the majority of serials)

Mar 06, 2009 06:07 PM

Active setup will help with the HKCU keys.

R-Vijay wrote an article  about it.

http://www.symantec.com/connect/blogs/active-setup

Mar 06, 2009 02:44 PM

 Plus... a lot of enterprises will block access to regedit where the reg add (or variant) will usually run just fine.  I agree with Brandon in that if you want anything into the current user key, you better know some vb  :)

Mar 06, 2009 02:36 PM

Even easier for a single key or two is to use REG ADD /? or REG DELETE /?. You can run these from a Run script without having to do imports/exports or clean anything up.

Regardless of your method, deploying HKCU keys with the DS isn't going to work without extra scripting. HKLM will work fine but HKCU are going to install under your installation account.

Related Entries and Links

No Related Resource entered.