Page 1 of 1

IA 9.06 hangs when READ REGISTRY reads certain values

Posted: Fri Aug 14, 2009 4:19 pm
by MikeOnline
In early versions of InstallAware 7, if you did a WRITE REGISTRY command to save a string value, and the data was an expanded variable, e.g. $VariableName$, and that variable was empty, then InstallAware would write the data literrally as $VariableName$.

In InstallAware 9.06, if you try to read this value into the same variable, it will hang.

InstallAware fixed WRITE REGISTRY at some point so if the data were an expanded variable, and that variable was empty, an empty string would be written. But READ REGISTRY still needs to be fixed, so it can read such values (such as user registration data) written by older InstallAware installers.

Below is an MIA script that will illustrate the problem. It will prompt you at one point to modify a registry value using REGEDIT so it appears the way that older InstallAware installers would have written it.

A work-around is to read back such values using a different variable name than was used in the older InstallAware installer (illustrated in the example).

- Michael

Note: could not successfully paste the code sample as InstallAware clipboard data into this post

Code: Select all

[OFFLINE CONTENT]
Comment: Test InstallAware 9 MIA script - 
Comment: AppHang when reading a registry value with data equal to the variable name surrounded by dollar signs
Comment: (this is how early versions of InstallAware 7 saved registry values contained in a variable set to an empty string)
if Variable REMOVE Equals TRUE
 Apply Uninstall (get result into variable SUCCESS)
 Set Variable PROGRESS to 100
 else
  
 Set Variable Phone to (415) 555-1212
 Set Variable Fax to 
 Set Variable SerialNo to 12345
  
 MessageBox: $TITLE$ Setup, Finished setting user registration variables, which are currently:$NEWLINE$$NEWLINE$Phone = $Phone$$NEWLINE$Fax = $Fax$$NEWLINE$SerialNo = $SerialNo$$NEWLINE$$NEWLINE$Fax is intentionally set to an empty string.
  
 Write Registry Key HKCU\\SOFTWARE\\MyTestApp\\Phone, $Phone$
 Write Registry Key HKCU\\SOFTWARE\\MyTestApp\\Fax, $Fax$
 Write Registry Key HKCU\\SOFTWARE\\MyTestApp\\SerialNo, $SerialNo$
  
 Apply Install (get result into variable SUCCESS)
 if Variable SUCCESS not Equals CANCEL
   if Variable SUCCESS not Equals ERROR
      
     MessageBox: $TITLE$ Setup, Finished test installation, which saved user registration values in the Registry.$NEWLINE$$NEWLINE$About to read back these user registration details from the Registry.
     Read Registry Key HKCU\\SOFTWARE\\MyTestApp\\Phone into Phone
     Read Registry Key HKCU\\SOFTWARE\\MyTestApp\\Fax into Fax
     Read Registry Key HKCU\\SOFTWARE\\MyTestApp\\SerialNo into SerialNo
     MessageBox: $TITLE$ Setup, Finished retrieving user registration details -- $NEWLINE$$NEWLINE$Phone = $Phone$$NEWLINE$Fax = $Fax$$NEWLINE$SerialNo = $SerialNo$$NEWLINE$$NEWLINE$If the Fax value had been saved using an early version of InstallAware 7, it would have been saved to the Registry as the word Fax (surrounded by dollar signs).  InstallAware 9.06 will hang if it tries to read such a value.  To test, run REGEDIT now and set the value of HKCU\\SOFTWARE\\MyTestApp\\Fax to %Fax% (except use dolar signs rather than percent signs).  Then click OK to re-read these values.
      
     Read Registry Key HKCU\\SOFTWARE\\MyTestApp\\Fax into Phone
     MessageBox: $TITLE$ Setup, Able to successfully read value Fax ($Fax$) into variable Phone.$NEWLINE$$NEWLINE$Will now try reading the same value into variable Fax.$NEWLINE$$NEWLINE$
      
     Read Registry Key HKCU\\SOFTWARE\\MyTestApp\\Fax into Fax
     MessageBox: $TITLE$ Setup, Able to successfully read value Fax ($Fax$) into variable Fax.$NEWLINE$$NEWLINE$
      
   end
 end
 Set Variable PROGRESS to 100
end

Posted: Mon Aug 17, 2009 1:46 pm
by neillans
Hi Mike,

Thanks for the bug report! I will get this processed and logged - will try and get a fix available as soon as possible ...