Announcement

Collapse
No announcement yet.

Auto-Detection of CODEC with Optional Installation

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

  • Auto-Detection of CODEC with Optional Installation

    For several months, I had been looking around for a program to invoke from AMS that would detect whether or not a codec was installed on a user's system and offer to install it if it were not. Queries to many forums and software vendors produced no results and so, lacking any knowledge of how, I was left to write my own. I did so as a 3 screen AMS project, and the attached ZIP (1 Mb, AVI included) contains my project files. I'm looking for some help with its testing, as I've only been able to test it on a single Windows Me computer thus far.

    As configured, this project tests for the presence of the DivX 5 codec by "DoesKeyExist" on the Registry key HKEY_LOCAL_MACHINE\System\CurrentControlSet\Contro l\MediaResources\icm\vidc.DIVX, but it can easily be reconfigured to test for any other installed codec simply by changing the fourCC code ("DIVX") that terminates the key. In fact, I simply changed this value to test for both installed and uninstalled codecs. The project ZIP contains additional documentation in a ReadMe file which also appears as the third (and final) screen of the three. Note that if you have the DivX 5 codec installed, you will not even see the first screen (options), as those options would then not be relevant.

    If you find this routine to be an effective solution to this problem, you're certainly welcome to use it in your own projects. I would simply ask that you e-mail me (my address is in the ReadMe) with a brief description of your product and its intended audience (resume credits), and most definitely if you encounter any problems in testing the routine.

    13383-Codec Test.zip

  • #2
    Re: Auto-Detection of CODEC with Optional Installation

    XP Pro: nada.

    I can't see the video, and I continue to get the text file "Not being installed", whether I exit the CD Application or not. I dont even see anything trying to be installed,.....usually XP tells ay somethign is, or asks for a signature.

    *shrugs*

    Comment


    • #3
      Re: Auto-Detection of CODEC with Optional Installation

      nice project. I don't do much with Videos but thought I would give it a try. It work fine on a WinXP Home box with DIVX 5 installed. After the Video plays it automatically jumps to the last page, did you want it to do this or not?

      the same key exists for DIVX 4.11 installations. Have you thought about trying to test for the data value in the description for that Reg_Key? If you are using DIVX 5 to encode your videos and the same key exists for earlier versions of DIVX will you run into problems? I thought I saw something about DIVX versions in your readme, that is why I ask.

      Here are some actions I assigned to a Text Object to test the functionality. It will test to see if the key is available and if it is it will check the version and if it is less than 5.0 it will offer to install. Just past these actions on a button in your project to see what I mean.

      <IR_ACTIONS_LIST>
      <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>%DivX%</Variable>
      <MainKey>3</MainKey>
      <SubKey>System\CurrentControlSet\Control\MediaReso urces\icm\vidc.DIVX</SubKey>
      </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>%DivX%</Condition>
      </Action>
      <Action name="Get Value Data">
      <Type>72</Type>
      <Function>0</Function>
      <DTIndentLevel>0</DTIndentLevel>
      <Enabled>1</Enabled>
      <ErrorHandling>
      <UserNotificationMode>2</UserNotificationMode>
      <CustomErrorMessage/>
      <OnErrorAction>0</OnErrorAction>
      <JumpToLabel/>
      </ErrorHandling>
      <Variable>%RegData%</Variable>
      <MainKey>3</MainKey>
      <SubKey>System\CurrentControlSet\Control\MediaReso urces\icm\vidc.DIVX</SubKey>
      <Value>Description</Value>
      <AutoExpand>0</AutoExpand>
      </Action>
      <Action name="Replace">
      <Type>60</Type>
      <Function>0</Function>
      <DTIndentLevel>0</DTIndentLevel>
      <Enabled>1</Enabled>
      <ErrorHandling>
      <UserNotificationMode>2</UserNotificationMode>
      <CustomErrorMessage/>
      <OnErrorAction>0</OnErrorAction>
      <JumpToLabel/>
      </ErrorHandling>
      <Variable>%RegData%</Variable>
      <SearchIn>%RegData%</SearchIn>
      <SearchFor> </SearchFor>
      <ReplaceWith>;;</ReplaceWith>
      <CaseSensitive>1</CaseSensitive>
      </Action>
      <Action name="Get Delimited String">
      <Type>64</Type>
      <Function>0</Function>
      <DTIndentLevel>0</DTIndentLevel>
      <Enabled>1</Enabled>
      <ErrorHandling>
      <UserNotificationMode>2</UserNotificationMode>
      <CustomErrorMessage/>
      <OnErrorAction>0</OnErrorAction>
      <JumpToLabel/>
      </ErrorHandling>
      <Variable>%RegData%</Variable>
      <Source>%RegData%</Source>
      <Delimiter>;;</Delimiter>
      <ItemIndex>1</ItemIndex>
      </Action>
      <Action name="Message Box">
      <Type>5</Type>
      <Function>0</Function>
      <DTIndentLevel>0</DTIndentLevel>
      <Enabled>1</Enabled>
      <ErrorHandling>
      <UserNotificationMode>2</UserNotificationMode>
      <CustomErrorMessage/>
      <OnErrorAction>0</OnErrorAction>
      <JumpToLabel/>
      </ErrorHandling>
      <DialogTitle>Title</DialogTitle>
      <DialogMessage>%RegData%</DialogMessage>
      <Icon>3</Icon>
      <Variable>%Result%</Variable>
      <DialogType>0</DialogType>
      <DefaultButton>0</DefaultButton>
      </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; 5.0</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>Warning</DialogTitle>
      <DialogMessage>Your version of DIVX is %RegData%. Some of the files on this CD require DIVX 5.0. Please Upgrade</DialogMessage>
      <Icon>1</Icon>
      <Variable>%Result%</Variable>
      <DialogType>0</DialogType>
      <DefaultButton>0</DefaultButton>
      </Action>
      <Action name="GOTO">
      <Type>209</Type>
      <Function>1</Function>
      <DTIndentLevel>2</DTIndentLevel>
      <Enabled>1</Enabled>
      <ErrorHandling>
      <UserNotificationMode>2</UserNotificationMode>
      <CustomErrorMessage/>
      <OnErrorAction>0</OnErrorAction>
      <JumpToLabel/>
      </ErrorHandling>
      <Label>Install</Label>
      </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="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="LABEL">
      <Type>208</Type>
      <Function>1</Function>
      <DTIndentLevel>1</DTIndentLevel>
      <Enabled>1</Enabled>
      <ErrorHandling>
      <UserNotificationMode>2</UserNotificationMode>
      <CustomErrorMessage/>
      <OnErrorAction>0</OnErrorAction>
      <JumpToLabel/>
      </ErrorHandling>
      <Label>Install</Label>
      </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>install DIVX</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>0</DTIndentLevel>
      <Enabled>1</Enabled>
      <ErrorHandling>
      <UserNotificationMode>2</UserNotificationMode>
      <CustomErrorMessage/>
      <OnErrorAction>0</OnErrorAction>
      <JumpToLabel/>
      </ErrorHandling>
      </Action>
      </IR_ACTIONS_LIST>
      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


      • #4
        Re: Auto-Detection of CODEC with Optional Installation

        Maybe I'm wrong, but I think you are missing what what I've done with this model. Please understand that this is ONLY a model.

        The model installs absolutely nothing. I'd never put anything into a model as severe as an install. What the model does is execute an AMS hook to an outside program. Were I to be actually implementing this, that program would be the codec install. Instead, it is merely an "open text file" command. No harm to anyone. That was my intent.

        The only difference in selecting Yes or No at the point you were at is that the same text file will open, but for Yes, the AMS program will close, and for No it will remain active. This is merely an option I provide for the prudent caution of those users who want their computers to be happy "the night after".


        By your question, I suspect you don't have DivX 5 installed. It's a good codec, but don't run out and install it just for this. No need to. You can test it anyways. All you have to do is go into "Project-->Actions-->On Initialize" and change the last four charaters to some codec you already have. If you are not sure of these (I suspect you are), simply go into system.ini and look for every 4-letter combo that follows "vidc." Those are your installed codecs.

        My model will then will then see your installed codec as the one it "wants", and in this case, you will bypass the options screen entirely and go directly to my video "splash" screen. In doing that of course, if you don't have the DivX 5 codec you will only see a white cross-hatched display while the soundtrack plays. When the soundtrack (i.e., the AVI object) ends, you'll move to a screen that simply displays my ReadMe file. This, of course, is supposed to be the first screen of what ever application you are doing.

        If you have gotten this far (phew!), I'm really interested in an XP test. Even the DivX folks wouldn't provide me any deatils about possible OS differences as regards to the Registry.

        Comment


        • #5
          Re: Auto-Detection of CODEC with Optional Installation

          Re: Jumping to last page. Yeah, that's the way I confingured it. The first page you see with DivX 5 is meant as a splash page while the second would be the "real" first page of whatever the application was. It obviously doesn't have to be done that way (i.e., you don't want a splash screen), but the way it is all coded, that splash screen doubles as a "user test" page if the viewer says they aren't sure it they have the codec (if I didn't properly detect the key).

          As to the key itself, at least in my Me machine the 3 versions of DivX have 3 different keys: "DIV3", "DIV4", and "DIVX", with the "DIVX" pointing to the DivX 5 DLL. I'll make it a point to check out the XP registry when I get a chance to get on a box with that.

          As to your Actions List, I'll have to spend a bit of time looking at that, as I'm not at all used to looking at the expanded code. Always stuck to those pop-up dialog boxes before this. In fact, before I got to this forum, I had never even seen the stuff. I guess this is as good a time to learn as any, huh!

          Thanks for the input.

          Comment


          • #6
            Re: Auto-Detection of CODEC with Optional Installation

            {quote]As to your Actions List, I'll have to spend a bit of time looking at that, as I'm not at all used to looking at the expanded code. Always stuck to those pop- up dialog boxes before this. In fact, before I got to this forum, I had never even seen the stuff. I guess this is as good a time to learn as any, huh

            [/quote]

            Don't waste time on trying to read the code, just copy and past it into the actions list in AMS4. It will translate back into the code you are used to seeing. Unless, of course you are masochistic then try to read the code. [img]/ubbthreads/images/icons/laugh.gif[/img]

            I will have to look for the other keys. the DIVX showing 4.11 on my Win2K box was in the same place that the 5.0 was on my WinXP box. I will do a search for the others.

            Tig
            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


            • #7
              Re: Auto-Detection of CODEC with Optional Installation

              Yeah, that pasting back made it a bit easier.

              I'm actually a bit wary going into the actual key data. Want you are pulling the "5.0" from is essentially a comment field, so there really isn't any way to guarentee that it will be the same or even similarly formatted in different install packages. You're kind of in the same situation even if you use the data in the "driver" field, as there is no guatentee that even that must remain the same.

              As to your problem with Win2K, a problem has been noted when installing DivX 5 in a computer that already has DivX 3 &amp; 4, and this is what you might be seeing. DivX 5, "overrides" 3 &amp; 4, forcing 5 to be used even when your fourCC says div3 or div4. On rare occasions, this can be a problem, where 5 doesn't decode 3 or 4 quite right, but mostly it is unnoticable. To avoid this problem, what you have to do is install (or re-install) 3 &amp; 4 after you install 5. I suspect you installed 5 after you installed 3 &amp; 4, and so what you are seeing is 3 &amp; 4 actually pointing to 5 and using that codec to do the decoding of all DivX files.

              By the way, this does not happen when you encode using DivX. Whichever version you tell your editor to use will be the version you get.

              Comment

              Working...
              X