Installer hangs on reading registry entry
Posted: Fri Nov 20, 2009 10:03 am
We've run into a strange problem with our latest software update and a very few users.
Our update installer checks for a serial number which is written by the main install into the windows registry (a string variable). The update uses the "Read Registry" command to get the string into a variable (SERIALNUM).
Now a few of our users reported the installer hanging during install. We've found out that it happens on reading the registry. Checking for their serial number in the registry, it turns out, it doesn't contain the serial number, but the string $SERIALNUM$.
Obviously, a previous installation must have fouled up and put the variable token string in there, instead of its content. But how is this even possible with the Write Registry command? Its Data field simply contains $SERIALNUM$. Note that this has only happened to in a couple instances.
We can fix the installer by using a different variable name (SERIALNUM2 instead of SERIALNUM), but how do we guard against this happening in the future? I obviously can't compare the string against $SERIALNUM$ since the code interpretes that as a variable token.
To reproduce, write a registry key manually, putting in $VARIABLE_NAME$ as the value. Try to read that key with the Read Registry command into the variable VARIABLE_NAME.
Thanks for you help,
Ralf Schemmann
Our update installer checks for a serial number which is written by the main install into the windows registry (a string variable). The update uses the "Read Registry" command to get the string into a variable (SERIALNUM).
Now a few of our users reported the installer hanging during install. We've found out that it happens on reading the registry. Checking for their serial number in the registry, it turns out, it doesn't contain the serial number, but the string $SERIALNUM$.
Obviously, a previous installation must have fouled up and put the variable token string in there, instead of its content. But how is this even possible with the Write Registry command? Its Data field simply contains $SERIALNUM$. Note that this has only happened to in a couple instances.
We can fix the installer by using a different variable name (SERIALNUM2 instead of SERIALNUM), but how do we guard against this happening in the future? I obviously can't compare the string against $SERIALNUM$ since the code interpretes that as a variable token.
To reproduce, write a registry key manually, putting in $VARIABLE_NAME$ as the value. Try to read that key with the Read Registry command into the variable VARIABLE_NAME.
Thanks for you help,
Ralf Schemmann