I'm toying with increasing simplification of an almost automated solution I've put together at work (way above and beyond, absolutely not called for, and not really required, but I think it would be cool to accomplish), involving a secure wireless software client application. I've pre-configured the MSI (installer package) to automatically store correct license and key values, settings, etc, using Orca (Microsoft's awesome MSI editor), scripted starting and setting to Automatic the Wireless Zero Configuration service in batch, and automated adding of the SSIDs and keys using an obscure command-line app for just such tasks made by Aruba, but one of my last endeavors has me temporarily stumped.
After the installer has completed, there is a setting whose default is not that which we desire. Therefore, you must open the application, click over to another tab, hit a button, check a box, and hit another button to save that modified setting. Not too bad, but I'm trying to develop a completely automated (unattended) install, so I can blast it out silently to a number of systems after hours.
Now, my first thought was, "That setting must either be stored in a file, or the registry", so I set out comparing the system's files and registry before and after, and isolated the two registry keys that controlled this setting. They were both REG_BINARY keys, containing about a thousand bytes of data each (in raw hex, as such: 00,0F,6A,34,33,). So, I simply exported a copy of each key (after the setting had been changed) to a .reg file, unchecked the box, saved the setting change, and ran (re-imported, by double-clicking) the .reg files. This accomplished the task (it checked the box for me and the setting was changed), but then I tried it on another system, and it checked the box, but the system failed authentication. Upon closer examination, it turned out that this REG_BINARY key's value controlled not only that setting, but about twenty other settings, and also contained a system-specific authentication key that was generated during installation.
Hence the conundrum. I will need to modify SOME bytes of the REG_BINARY value, and not others. I performed a comparison between these keys before and after, using WinMerge, and isolated the differences (hence, the pieces I'll need to change, which shouldn't affect the auth key or other settings), but there doesn't seem to be a simple solution for editing a REG_BINARY value. I thought perhaps I could export both keys, and perform a command-line search+replace, then import both modified keys, but every app I tried that claimed to do that failed (most because they didn't support binary files, some for reasons unknown, and they don't have adequate documentation). I looked into VBScripting the solution, but VBScript's REGWRITE command can only write two bytes of data to a REG_BINARY, per Microsoft (wtf?).
I suppose I could write a program to parse the binary data in the reg exports, but I'd imagine that to be a real bitch, and it's not like I'm adept at reading and patching binary files in any language.
Does anyone have any idea as to a good method of doing what I'm getting at? I won't be disappointed if no one does, but it would be interesting to hear a solution, nonetheless. If nothing else, it's interesting that there isn't a simple way to automate this, and if there currently isn't, and I or anyone else develops a solution, it should be shared, so others can benefit. I've seen quite a few other people asking about the same thing on various forums, with no decent responses.



Reply With Quote


