Announcement

Collapse
No announcement yet.

Checking for Direct X

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Checking for Direct X

    I think this was Corey's coding below...

    If I change the IF (%RegData% < 4.08.01.0000) to IF (%RegData% < 4.09.00.0902) it does nothing. What am I not changing correctly? Take a look.

    <IR_ACTIONS_LIST>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>Setting DoesKeyExist to a default value so we can run a test on it.</Comment>
    </Action>
    <Action name="Set Value">
    <Type>6</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%DoesKeyExist%</Variable>
    <Value>NOTFOUND</Value>
    <Evaluate>0</Evaluate>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>This will search the registry to see if that key exists.</Comment>
    </Action>
    <Action name="Does Key Exist">
    <Type>70</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%DoesKeyExist%</Variable>
    <MainKey>3</MainKey>
    <SubKey>SOFTWARE\Microsoft\DirectX</SubKey>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>Now we are going to check and see if the key was found or not. If found it will check the version. if not it will tell you so.</Comment>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>%DoesKeyExist% = "NOTFOUND"</Condition>
    </Action>
    <Action name="Message Box">
    <Type>5</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <DialogTitle>Title</DialogTitle>
    <DialogMessage>DirectX not installed</DialogMessage>
    <Icon>3</Icon>
    <Variable>%Result%</Variable>
    <DialogType>0</DialogType>
    <DefaultButton>0</DefaultButton>
    </Action>
    <Action name="ELSE">
    <Type>206</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>This will check for the version of DirectX</Comment>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>directx 9.0b is 4.09.0000.0902</Comment>
    </Action>
    <Action name="Get Value Data">
    <Type>72</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%RegData%</Variable>
    <MainKey>3</MainKey>
    <SubKey>SOFTWARE\Microsoft\DirectX</SubKey>
    <Value>Version</Value>
    <AutoExpand>0</AutoExpand>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>If it is less than 8.1 it will offer to upgrade</Comment>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>%RegData% &amp;lt; 4.09.00.0902</Condition>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>%RegData% &amp;lt; 4.08.01.0000</Condition>
    </Action>
    <Action name="Message Box">
    <Type>5</Type>
    <Function>0</Function>
    <DTIndentLevel>2</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <DialogTitle>Title</DialogTitle>
    <DialogMessage>You are running an older version of DirectX, would you like to upgrade.</DialogMessage>
    <Icon>3</Icon>
    <Variable>%Result%</Variable>
    <DialogType>1</DialogType>
    <DefaultButton>0</DefaultButton>
    </Action>
    <Action name="ELSE">
    <Type>206</Type>
    <Function>1</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Message Box">
    <Type>5</Type>
    <Function>0</Function>
    <DTIndentLevel>2</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <DialogTitle>Title</DialogTitle>
    <DialogMessage>You are running the current version of DirectX</DialogMessage>
    <Icon>3</Icon>
    <Variable>%Result%</Variable>
    <DialogType>0</DialogType>
    <DefaultButton>0</DefaultButton>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    </IR_ACTIONS_LIST>

  • #2
    Re: Checking for Direct X

    IF (%RegData% < 4.09.0000.0902)
    Try that. Seems like you were just short 2 numbers in the 3rd grouping.

    Comment


    • #3
      Re: Checking for Direct X

      NOPE! didn't work...
      Thx for the reply.

      Comment


      • #4
        Re: Checking for Direct X

        Bruce, I see a couple of things that might be fouling things up here. First is the way that version math works in AMS. In my registry, it says I have version 4.09.00.0902 I don’t know if that is version 9b or not. I’m guessing that it’s not the newest version. Since your program is looking for version 4.09.0000.0902 I’m guessing that the version with the four zeros in the third grouping represents a newer version than what is on my machine (Not too surprising). If my assumptions are true, then AMS wouldn’t differentiate between four zeros and two zeros, when it did it’s little subtraction to compare versions. Any number if zeros minus any number of zeros is still zero, or zero change as far as AMS is concerned. If this is the case, I wonder if the version search can be combined with checking one of the other keys.

        The other problem I see, is how the ‘if “ statements are nested, at the end of your script. It asks the first if, but doesn’t say “what” before it asks the second “if”.

        Comment


        • #5
          Re: Checking for Direct X

          Bruce,

          This works for me.

          // Setting DoesKeyExist to a default value so we can run a test on it.
          %DoesKeyExist% = "NOTFOUND"
          // This will search the registry to see if that key exists.
          %DoesKeyExist% = Registry.DoesKeyExist ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectX ")
          // Now we are going to check and see if the key was found or not. If found it will check the version...
          IF (%DoesKeyExist% = "NOTFOUND")
          %Result% = Dialog.MessageBox ("Title", "DirectX not installed", Ok, Question)
          ELSE
          // This will check for the version of DirectX
          // directx 9.0b is 4.09.0000.0902
          %RegData% = Registry.GetValueData ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectX ", "Version")
          %Result% = Dialog.MessageBox ("Title", "%RegData%", Ok, Question)
          // If it is less than 8.1 it will offer to upgrade
          IF (%RegData% < 4.09.00.0902)
          %Result% = Dialog.MessageBox ("Title", "You are running an older versi...", Yes|No, Question)
          ELSE
          %Result% = Dialog.MessageBox ("Title", "You are running the current ve...", Ok, Question)
          END IF
          TJ-Tigger
          "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
          "Draco dormiens nunquam titillandus."
          Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

          Comment

          Working...
          X