PDA

View Full Version : File.GetVersionInfo from a .sys file ??


qwerty
02-21-2007, 11:47 AM
This is a snippet of code that is giving me a headache, basically i step into this code should the main file i want to check the version of is missing for whatever reason (main file is an exe and same code works ok), but for this sys file i keep getting a " Attempt to index global 'prev_info' (a nil value) " Error on the last line, is it not possible to grab the file info from a sys file type ??

bakup_file = String.Concat(_SystemFolder, "\\My_File.sys");
prev_info = File.GetVersionInfo(bakup_file);
-- Clear Last Error Code --
Application.SetLastError(0); -- set the last error to "no error occurred"
-- Get File Version of backup file --
prev_version = prev_info.FileVersion;

qwerty
02-21-2007, 11:59 AM
grrrrr.... ok, boy do i feel stupid :p .... worng file location was causing the problem, i missed out part of the file path ... oops!

but it has presented me with another problem, in that it is possible that if my code looks for the original exe, doesnt find it, it then checks this backup file, if that too is missing, then it errors ....

This was expected, however my error check routine is not catching it and i am getting the popup error which then exits the script, that wasnt suppossed to work like that !! ... back to the drawing board