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

typdef installshield question


4 replies to this topic

arfinsd

arfinsd
  • Members
  • 28 posts

Posted 12 July 2002 - 18:45

If I have created a struct like the following.

typedef OP_SYS
begin
   BOOL IsWindowsXP(FALSE);
   BOOL IsWindowsME(FALSE);
   BOOL IsWindows2000(FALSE);
   BOOL IsWindows2000Workstation(FALSE);
   BOOL IsWindows2000Server(FALSE);
   BOOL IsWindowsNT4(FALSE);
   BOOL IsWindowsNT351(FALSE);
   BOOL IsWindows98(FALSE);  
   BOOL IsWindows95(FALSE);
end;      

OP_SYS  gstructOSType;

now if I set some values...

if (SYSINFO.WINNT.bWin2000) then
   gstructOSType.IsWindows2000 = TRUE;  
elseif (SYSINFO.WIN9X.bWin95) then
   gstructOSType.IsWindows95 = TRUE;    
elseif (SYSINFO.WIN9X.bWin98) then
   gstructOSType.IsWindows98 = TRUE;
elseif (SYSINFO.WIN9X.bWinMe)then
   gstructOSType.IsWindowsME = TRUE;  
elseif (SYSINFO.WINNT.bWinNT ) then
   ...perform some other operations...

If I'm running on a Windows 2000 machine, I step through the code, and the IsWindows2000 value is set to true. When I perform another check like:

if ( (gstructOSType.IsWindowsNT351 ||      
     gtructOSType.IsWindows95 ||
     gstructOSType.IsWindows98 ||
     gstructOSType.IsWindowsME) == TRUE ) then
   MessageBox(PRODUCT_NAME + " can only be installed on a machine with a Windows NT 4.0 or a Windows 2000 platform.", SEVERE);
       abort;
endif;

I get the messagebox, and I'm not sure why. These values are set to true for some reason If I create a bunch of global variables, then it runs correctly. When I try to use the structure, even though only the IsWindows2000 value is set to true....the other guys are evaluated to true. Can anyone tell me why?

Alex ???
Alex Ferguson
www.SolimarSystems.com

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 13 July 2002 - 00:07

I've never messed with structures in IS, but there are much easier's ways to get the desired affect than resorting to all that.

For instance you could just use SYSINFO.WINNT.bWinNT directly or have a local function which you call to get the result.
user posted image

arfinsd

arfinsd
  • Members
  • 28 posts

Posted 13 July 2002 - 00:13

I was just curious on why it doesn't work. I already have a solution to the problem...Damn Taco Bell, why don't you have the answer!! Just kidding.   :)
Alex Ferguson
www.SolimarSystems.com

prozacrefugee

prozacrefugee
  • Members
  • 38 posts

Posted 23 September 2002 - 22:03

I've noticed that InstallShield isn't great about always initializing its booleans - sometimes it gives them a true or leaves them undefined.  Are you setting them to false prior to checking them?

prozacrefugee

prozacrefugee
  • Members
  • 38 posts

Posted 23 September 2002 - 22:05

Oops!  Just saw that you were initializing in the declaration.  My bad!

You still might want to try settin them to false explicitly and seeing if that produces any change.