Cannot detect file in system32 folder

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • kmartin7
    Forum Member
    • Jun 2002
    • 57

    Cannot detect file in system32 folder

    search_results = File.Find("C:\\WINNT\\system32\\", "tsccvid.dll", true, true, nil);

    if search_results then
    Dialog.Message("Found File", "We found the codec.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    else
    proceed = Dialog.Message("CODEC Not Available", "It appears that you do not have a CODEC needed to view the videos in this demo. Please click the OK button to install.", MB_OKCANCEL, MB_ICONINFORMATION, MB_DEFBUTTON1);
    end

    if proceed == IDOK then
    File.Run("AutoPlay\\Docs\\TSCC.exe", "", "", SW_SHOWNORMAL, false);
    end

    I don't know why this always returns true, whether the dll is there or not. Any ideas?

    Kurt
  • Intrigued
    Indigo Rose Customer
    • Dec 2003
    • 6138

    #2
    I did not try this code out, so please let me know if it will work (or if it gets you to a solution that works). Thank you.

    Code:
    search_results = File.Find("C:\\WINNT\\system32\\", "tsccvid.dll", true, true, nil); 
    
    if (search_results == false) then 
    	proceed = Dialog.Message("CODEC Not Available", "It appears that you do not have a CODEC needed to view the videos in this demo. Please click the OK button to install.", MB_OKCANCEL, MB_ICONINFORMATION, MB_DEFBUTTON1); 
    	     if (proceed == IDOK) then 
    		File.Run("AutoPlay\\Docs\\TSCC.exe", "", "", SW_SHOWNORMAL, true);
                              Dialog.Message("Install Complete!","The CODEC is now installed.  You are ready to watch the demo videos!");
    	     else
    	     end
    end
    Last edited by Intrigued; 03-09-2004, 06:40 PM.
    Intrigued

    Comment

    • TJ_Tigger
      Indigo Rose Customer
      • Sep 2002
      • 3159

      #3
      To support multiple file systems you might want to change

      "C:\\WINNT\\system32\\"

      to

      _SystemFolder

      Tigg
      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

      • kmartin7
        Forum Member
        • Jun 2002
        • 57

        #4
        It still does not work! It returns true, and will not attempt to install the codec. This is what I have:

        search_results = File.Find("_SystemFolder", "tsccvid.dll", true, true, nil);

        if (search_results == false) then
        proceed = Dialog.Message("CODEC Not Available", "It appears that you do not have a CODEC needed to view the videos in this demo. Please click the OK button to install.", MB_OKCANCEL, MB_ICONINFORMATION, MB_DEFBUTTON1);
        if (proceed == IDOK) then
        File.Run("AutoPlay\\Docs\\TSCC.exe", "", "", SW_SHOWNORMAL, true);
        Dialog.Message("Install Complete!","The CODEC is now installed. You are ready to watch the demo videos!");
        else
        end
        end

        Any more ideas? I have tried this about 20 different ways to no avail. I have verified that the file does NOT exist.

        Thanks!

        Comment

        • Worm
          Indigo Rose Customer
          • Jul 2002
          • 3971

          #5
          Another thing is that it might be that the DLL is in a sub folder too. Since you are recursing folders, if the DLL is in the System folder or any of the sub folders, it's going to return true.

          If you know for sure that the file is going to be in the System folder, do this instead:

          if not File.DoesExist(_SystemFolder .. "\\tsccvid.dll") then
          --your code to install the codec here
          end

          Comment

          • kmartin7
            Forum Member
            • Jun 2002
            • 57

            #6
            Bingo!

            Thanks Worm.

            Kurt

            Comment

            • Worm
              Indigo Rose Customer
              • Jul 2002
              • 3971

              #7
              Just a word of caution here though. If the Search was returning TRUE using the recurse folders. The DLL must be on the system already. So the question is, if it's on the system, is the codec already installed?
              Last edited by Worm; 03-09-2004, 07:52 PM.

              Comment

              • Intrigued
                Indigo Rose Customer
                • Dec 2003
                • 6138

                #8
                Worm...

                When does a .dll like this get put (if ever) into the dllcache folder on a Windows XP (Me in this example) folder?
                Intrigued

                Comment

                • Worm
                  Indigo Rose Customer
                  • Jul 2002
                  • 3971

                  #9
                  My understanding of the dllcache folder is that the OS keeps a copy of all "protected" dlls in that folder. No application is supposed to be able to update the dll in the system folder if it is also in the dllcache folder. Even if you copy a dll in manually, it will appear to copy, but the OS intercepts, and copies a the "protected" dll from the dllcache folder instead.

                  The only way these DLLs are supposedly able to be updated is through a Service Pack, or System Update. I've been told that as long as the newer DLL has the correct digitial signature, it will replace the current "protected" dll.

                  At least that's my understanding... I'm sure someone else will chime in if I've got it wrong.

                  Comment

                  • Intrigued
                    Indigo Rose Customer
                    • Dec 2003
                    • 6138

                    #10
                    Another situation to watch out for when installing Techsmith's codec...

                    On Windows NT, W2K and XP, administrator rights are required to install codecs.

                    source: http://fr.techsmith.com/products/studio/faqs.asp

                    Glad a solution was found. I own Camtasia Studio 2.0 myself and I am glad this was resolved in case I ever decide to use their codec in a project.
                    Intrigued

                    Comment

                    • Intrigued
                      Indigo Rose Customer
                      • Dec 2003
                      • 6138

                      #11
                      Thank you for that explanation. I had been wondering on that for a while and never took the time to 'google' my way to the answer.

                      *Worm... I just keep looking for I.R. to put a PayPal clickable-donate link by your name any day now! (grin)

                      This goes for TJ_Tigger as well!
                      Last edited by Intrigued; 03-09-2004, 08:11 PM.
                      Intrigued

                      Comment

                      • Worm
                        Indigo Rose Customer
                        • Jul 2002
                        • 3971

                        #12
                        Tig Rocks!

                        Comment

                        Working...
                        X