wmansur
06-06-2007, 10:05 AM
Hi all,
InstallShield 11.5, Professional Edition and I have an ibstall with a Custom Action that appears to be working incorrectly. When I run the install in DeBug mode, the CA function is run but it appears that no values are being set by it. Even when using the MSIGetProperty function.
I have been researching this type of issue for a couple of days now and I have found a lot of good information and advice about it. However, I am at the point where my dialog is almost completely working as intended with just one strange issue.
I have a dialog box that sets a server location using a Custom Action. The DoAction is set to run when the user clicks on the NEXT button. I have the DoAction set first, above the other 2 "NewDialog" actions for the NEXT button. The location is sent to the registry under HKCU\Software\CompanyName\Teest\Settings and the value is to be [SERVER] (which is in the Property Manager table as a Public property), based on the results of the dialog box (which are read by the Custom Action).
What the dialog box looks like (I also upoaded an image of it):
There is a RadioGroup with 2 buttons - Automatic and Manual. There is also an EditBox (labeled "ServerAddress:"), that can be populated from the command line or by selecting Manual.
The issue I have is that if I set the server location from the command line (i.e., setup.exe /v"SBCMDLINE=test" or by selecting "Manual" in the dialog box and entering "test" in the EditBox, that all works. When the NEXT button is clicked, the registry value is set correctly with a server name of "test". When I just leave the default "Automatic" alone, the registry value is set to Nothing when I click on the NEXT button. I would like it to say "Automatic".
I do have several properties in the Property Manager.
These three are public:
SERVER set with no value
SBSERVER set with no value
SBAUTO set with a value of Automatic
I use this next value in the Custom Action to determine which RadioButton has been selected:
nRadio, value is set to 1 in the Property Manager (so that it is the default - the RadioButton labeled Atuomatic)
When I run this install in "DeBug" mode, the install goes into the custom action code. If "Automatic" is the selection it appears that the "Automatic" value does not get set.
The Custom Action is an InstallScript type CA and it is placed in the Installation Sequence right after "CostFinalize".
Couple of other strange things:
If I use the MSIGetProperty function here, the CA appears to act as if "Automatic" was selected (in the value "svAuto") but nothing is put in the Registry Value. Also, if I use a CA to set the property SBAUTO to "Automatic", the Registry Value always gets set to "Automatic". (Even when setting the value from the command line or by selecting "Manual" in the dialog).
This is the code. I do have a setup.rul with "OnBegin" and "OnEnd" sections that are empty.
#ifndef __CUSTOMACTIONS_RUL__
#define __CUSTOMACTIONS_RUL__
export prototype ExFn_NextProcessing(HWND);
function ExFn_NextProcessing(hMSI)
BOOL NextPage;
//These are PUBLIC
STRING SBAUTO, SBSERVER, SBCMDLINE;
STRING svAuto;
NUMBER nRadio, nvSize;
begin
// This MsiGetProperty doesn't seem to work right...
nvSize = 256;
MsiGetProperty (hMSI, "SBAUTO", svAuto, nvSize);
// In Debug mode, this code is stepped thru but no values are assigned...
// Only if nRadio = 1
if (nRadio == 1) then
SBSERVER = svAuto;
NextPage=TRUE;
else
// if nRadio != 1 and SBCMDLINE has a value (i.e., Test)
if (SBCMDLINE != "") then
SBSERVER = SBCMDLINE;
NextPage=TRUE;
else
NextPage=FALSE;
endif;
endif;
if (NextPage=TRUE) then
Enable (NEXTBUTTON);
else
Disable (NEXTBUTTON);
endif;
end;
#endif // __CUSTOMACTIONS_RUL__
Thanks in advance for any help or advice.
-Walter
InstallShield 11.5, Professional Edition and I have an ibstall with a Custom Action that appears to be working incorrectly. When I run the install in DeBug mode, the CA function is run but it appears that no values are being set by it. Even when using the MSIGetProperty function.
I have been researching this type of issue for a couple of days now and I have found a lot of good information and advice about it. However, I am at the point where my dialog is almost completely working as intended with just one strange issue.
I have a dialog box that sets a server location using a Custom Action. The DoAction is set to run when the user clicks on the NEXT button. I have the DoAction set first, above the other 2 "NewDialog" actions for the NEXT button. The location is sent to the registry under HKCU\Software\CompanyName\Teest\Settings and the value is to be [SERVER] (which is in the Property Manager table as a Public property), based on the results of the dialog box (which are read by the Custom Action).
What the dialog box looks like (I also upoaded an image of it):
There is a RadioGroup with 2 buttons - Automatic and Manual. There is also an EditBox (labeled "ServerAddress:"), that can be populated from the command line or by selecting Manual.
The issue I have is that if I set the server location from the command line (i.e., setup.exe /v"SBCMDLINE=test" or by selecting "Manual" in the dialog box and entering "test" in the EditBox, that all works. When the NEXT button is clicked, the registry value is set correctly with a server name of "test". When I just leave the default "Automatic" alone, the registry value is set to Nothing when I click on the NEXT button. I would like it to say "Automatic".
I do have several properties in the Property Manager.
These three are public:
SERVER set with no value
SBSERVER set with no value
SBAUTO set with a value of Automatic
I use this next value in the Custom Action to determine which RadioButton has been selected:
nRadio, value is set to 1 in the Property Manager (so that it is the default - the RadioButton labeled Atuomatic)
When I run this install in "DeBug" mode, the install goes into the custom action code. If "Automatic" is the selection it appears that the "Automatic" value does not get set.
The Custom Action is an InstallScript type CA and it is placed in the Installation Sequence right after "CostFinalize".
Couple of other strange things:
If I use the MSIGetProperty function here, the CA appears to act as if "Automatic" was selected (in the value "svAuto") but nothing is put in the Registry Value. Also, if I use a CA to set the property SBAUTO to "Automatic", the Registry Value always gets set to "Automatic". (Even when setting the value from the command line or by selecting "Manual" in the dialog).
This is the code. I do have a setup.rul with "OnBegin" and "OnEnd" sections that are empty.
#ifndef __CUSTOMACTIONS_RUL__
#define __CUSTOMACTIONS_RUL__
export prototype ExFn_NextProcessing(HWND);
function ExFn_NextProcessing(hMSI)
BOOL NextPage;
//These are PUBLIC
STRING SBAUTO, SBSERVER, SBCMDLINE;
STRING svAuto;
NUMBER nRadio, nvSize;
begin
// This MsiGetProperty doesn't seem to work right...
nvSize = 256;
MsiGetProperty (hMSI, "SBAUTO", svAuto, nvSize);
// In Debug mode, this code is stepped thru but no values are assigned...
// Only if nRadio = 1
if (nRadio == 1) then
SBSERVER = svAuto;
NextPage=TRUE;
else
// if nRadio != 1 and SBCMDLINE has a value (i.e., Test)
if (SBCMDLINE != "") then
SBSERVER = SBCMDLINE;
NextPage=TRUE;
else
NextPage=FALSE;
endif;
endif;
if (NextPage=TRUE) then
Enable (NEXTBUTTON);
else
Disable (NEXTBUTTON);
endif;
end;
#endif // __CUSTOMACTIONS_RUL__
Thanks in advance for any help or advice.
-Walter