Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

ComponentIsItemSelected not working?


5 replies to this topic

cswarwick

cswarwick
  • Members
  • 6 posts

Posted 31 October 2002 - 00:12

Hi all,

I have a user who wrote me the following: "From the Components screen, all the components are selected by default. When I click Next, a dialog informs me that I have not selected any components, and I cannot continue with the installation. I have tried deselecting and reselecting; no combination allows me to continue. What do you suggest?"  I am unable to recreate this issue...  

The logic behind this screen (SdComponentTree) is such that we verify which components are selected by using ComponentIsItemSelected, then I set booleans to TRUE (selected) or FALSE (not selected) based on the result. When the user clicks Next, I verify that at least one of these booleans is set to TRUE before allowing the user to continue. If not, they will get the MessageBox the user mentions above. Obviously, this user has tried various combinations and is unable to continue. This suggests to me that ComponentIsItemSelected isn't working properly.  

This seems to occur VERY randomly, and like I said, I can't seem to recreate myself. Our QA department ran into it at one point and wasn't able to consistently recreate either and it seems to have stopped happening altogether in-house... Does anyone have any insight to what may be causing this, how I could "fix" my code, and/or how users can work around it?  We're on IS Pro 6.22. Thanks in advance for your help!

Christina

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 31 October 2002 - 03:20

For starters, do you have more than one setup type or do you always do a Custom type setup and therefore require the user to make component selections?

Now since this is a random problem, one idea would be to add some logging capability to your setup, so you can determine exactly what's going on here.  It will certainly take some work to get this incorporated in your setup, but believe me, it's well worth it in the long run.

I would also suggest posting a copy of this & the immediately surrounding code.
user posted image

cswarwick

cswarwick
  • Members
  • 6 posts

Posted 31 October 2002 - 17:46

Users are always required to go through the Custom setup screen.  I guess I'm not sure what you mean by adding logging to the install. Here's a sample of the code being used (for one of the components, I removed references to all others).  We have differeing processes if the user is upgrading or installing new, and that bool is set in the dialog prior to this one.

Dlg_Components:
   szTitle = @DLG_COMPONENT_TITLE;
   szMsg = @DLG_COMPONENT_MESSAGE;
   svDir = "C:\\" + @FOLDER_NAME^@FOLDER_PROD_NAME;  

   nResult = SdComponentTree(szTitle, szMsg, svDir, szComponents, 3);
  listStartCopy = ListCreate( STRINGLIST );


//check for Database component selection
if (ComponentIsItemSelected(MEDIA, @COMPONENT_COMPLETE + "\\" + @COMPONENT_SQL) = TRUE)&&(bNewInstall = TRUE) then
  bInstCompSQL = TRUE;
  bUpgCompSQL = FALSE;    
  ListAddString(listStartCopy, "\t" + @COMPONENT_SQL, AFTER);

elseif (ComponentIsItemSelected(MEDIA, @COMPONENT_COMPLETE + "\\" + @COMPONENT_SQL) = TRUE)&&(bUpgrade = TRUE) then
  bInstCompSQL = FALSE;
  bUpgCompSQL = TRUE;
  ListAddString(listStartCopy, "\t" + @COMPONENT_SQL, AFTER);  

//if user deselects Component, reset all booleans to FALSE elseif (ComponentIsItemSelected(MEDIA, @COMPONENT_COMPLETE + "\\" + @COMPONENT_SQL) = FALSE)then
  bInstCompSQL = FALSE;
  bUpgCompSQL = FALSE;
endif;

if ((bInstCompSQL = FALSE) && (bUpgCompSQL = FALSE)) then
  MessageBox(@ERR_NO_COMPONENTS_SELECTED, WARNING );
  goto Dlg_Components;
endif;

The list is used in SdStartCopy so that users can verify they've selected components they want before they start the file copy process.  That's about it - see anything that stands out?  Thanks!

Christina

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 01 November 2002 - 03:48

First logging is basically writing your own debug messages out to a text file, so that if a problem arises you can go back and see what was the happening.

Items to log would include whether a full or upgrade installation was started, the current install directory if any, the selected setup type, the selected components, etc.

---

As for your code, first off I can't say I approve of your methods.  It's overkill and so redudant especially since you do all the same stuff for every component.  For example, why not have a global bFull boolean which signifies whether it's a full install meaning TRUE or an upgrade meaning FALSE.

Also, why not make a special hidden component so that special components such as Program Files cannot be deselected.  After all, what good is a setup without the executables?!?!?!  To do so, make a new component, say !_Ghost_, and make Program Files one of its required components.  Then make it hidden and therefore invisible to users.

Also, is szComponents null thereby making all components visible?  If so, why not just pass ""?  However, this isn't the reason you wrote in, so I'll move on ...

---

Now, in looking at your code, one way your setup wizard could get stuck is if earlier it couldn't figure out if it either bNewInstall or bUpgrade were TRUE, thereby never allowing any of your component booleans to become TRUE.

I would therefore check occurences of each of these two variables and see if there are any holes in your code along these lines.

Good luck Christina and I wish you success in your venture.
user posted image

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 08 November 2002 - 03:36

Hey Christina, any luck?  I'm interested to hear back as to how you made out, so I would appreciate a reply.
user posted image

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 11 November 2002 - 20:04

Another point is component names stored in the string table. If this is a multi language setup it may fail in some languages because of typos in the component names.