Use the Registry to Track Changes and Audit
A simple tip to track changes is to create a registry key under "HKLM\Software\\". When you run scripts or installations it is simple through almost all languages to add a string value with some information like install time.
By creating these keys, it becomes very simple to create logic in DS deployment scripts to make decision trees for future deployments and upgrades. This is also helpful for future auditing.
REG (REG /? from a DOS prompt to get help) is a magnificent tool to add registry entries with through DOS and it’s built into XP SP2. It can also be used to Query your key. Vbscript uses RegWrite and RegRead to perform the same actions.
Good luck with your new tracking options!
- Login or register to post comments
- 1216 reads
- Printer-friendly version
















Examples
Excellant tip. Can you provide some examples of how to use REG to query values in the registry?
I've got an example
I used this DOS script in task server to install the Microsoft C++ Redistributable Package. The registry key that it is querying is only present when the software is installed (my own detective work). So if the key does not exist, the "reg" command goes to an ERRORLEVEL of 1 and that can be used to evaluate if the software should be installed. If the error level is 0 (which would be the case if the registry key exists) then I just echo back that it's installed. The echoing is just my way of figuring out if the script ran correctly.
What if?
Good example. I'll use it for new installs. But what about upgrades where there aren't any new keys and I haven't, as of yet, created my own unique keys?
CustInv
I have customers that do this for all of their packages. They normally use SWD to deploy them, and CustInv to read the reg values after the install so that they can receive confirmation that a specific application build has been installed onto that machine.
I like the idea of using such registry entries for DS.
Swallen, that is a
Swallen, that is a difficult question to answer. You are kind of forced to ease into it and have to use other methods until you can get some implementation time behind you. Add/remove programs and if file exists are sometimes but not always helpful. I will try to gather some other scripts to help you out with this.mte
Uninstalls and Upgrades
We use this with NS as well and have a custom inventory job that reports the registry keys back to the NS for reporting. If you adopt this practice, consider that you may need to address how to handle the registry key when an application is uninstalled, upgraded, etc.