PDA

View Full Version : Cannot detect file in system32 folder



kmartin7
03-09-2004, 06:28 PM
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
03-09-2004, 07:38 PM
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.


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

TJ_Tigger
03-09-2004, 07:51 PM
To support multiple file systems you might want to change

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

to

_SystemFolder

Tigg

kmartin7
03-09-2004, 08:09 PM
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!

Worm
03-09-2004, 08:12 PM
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

kmartin7
03-09-2004, 08:21 PM
Bingo!

Thanks Worm.

Kurt

Worm
03-09-2004, 08:27 PM
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?

Intrigued
03-09-2004, 08:33 PM
Worm...

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

Worm
03-09-2004, 08:52 PM
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.

Intrigued
03-09-2004, 09:00 PM
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
03-09-2004, 09:03 PM
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!

Worm
03-09-2004, 09:19 PM
Tig Rocks!