ZenKensei Posted February 25, 2004 Share Posted February 25, 2004 Group, First, just want to say a big THANKS to all of you out there who have worked on and helped make AutoIt V3 what it is (and is becoming), your efforts are most appreciated. Now for the 2nd reason for the e-mail. I need some suggestions on the following code, it works uncompiled, but I receive an error (sorry, it flashes to quick to see) when I try and compile it. $Scrver = '5.6.0.6626' $Filever = FileGetVersion ( @SystemDir & "\Scrrun.Dll" ) If $Scrver = $Filever Then FileOk($Scrver, $FileVer) Else NotOk($Scrver, $Filever) EndIf Func FileOK($Scrver, $FileVer) SplashTextOn("File Version", "Version of Scrrun.Dll is correct.", 450, 90) Sleep(3000) SplashOff() EndFunc Func NotOk($Scrver, $Filever) SplashTextOn("File Version", "Version of Scrrun.Dll is INCORRECT - Installing.", 450, 90) Sleep(3000) SplashOff() FileInstall(@ScriptDir & "\Scrrun.Dll", @SystemDir & "\Scrrun.Dll") EndFunc Exit Background: Our internal software development team recently rolled out a new version of software that we use throughout the company. The problem arose when as part of their installation package they included an older version of the Scrrun.dll file (included with the Microsoft WSH 5.1). Our Enterprise is running WSH 5.6 as a general rule and the installation of this old file has caused problems with our Enterprise logon script which is a .VBS script called from a Logon.bat front end (NT4 Domain, what can I say...). This old version file is causing an error when we start the call of the .VBS file. My solution was to write and compile the AutoIt3 script and call it from the batch file front end, it would check the currently installed version of the file on the workstation and if not the version of the WSH 5.6 package, install the file from the compiled script (as this is a system file, I will need to insure that on Win2k and WinXP that the file is actually copied into the @SystemDir\DllCache folder). Thanks in advance... Link to comment Share on other sites More sharing options...
ZenKensei Posted February 25, 2004 Author Share Posted February 25, 2004 DOH!!! Nevermind... I found the solution to my own problem. Forgot about the fact that the fileinstall 'source' path cannot be a variable. I can't believe the amount of time I spent looking through posts and example scripts trying to find the solution to the issue. Oh well, its only time. Link to comment Share on other sites More sharing options...
CyberSlug Posted February 25, 2004 Share Posted February 25, 2004 I'm make sure the help file puts this info in bold. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
BobHansen Posted February 25, 2004 Share Posted February 25, 2004 First day user, so consider the source, but I am looking to bring myself up to speed. Changes made by me are in Bold Blue.I did a copy/paste and ran your script. I made a modification on the last line to prevent the copy from executing. I made that a comment line. I then ran the file and it appeared to run OK.I then compiled the file into an EXE. I ran the compiled version with the same result, it looked OK. I removed the scrrun.dll and ran manually again. Got the message that it was incorrect, and copy would be processed. Appears OK. Recompiled, same results.Moved scrrun.dll file to ScriptDir, removed comment to allow copy, and ran manually again. File was copied to folder as desired..runs OK.Compiled file again, and got an error message: Invalid File Install Function()FileInstall(@ScriptDir & "\Scrrun.Dll", @SystemDir & "\Scrrun.Dll")Reviewing the FileInstall function I see that "The source path of the file to compile must be a string; it cannot be a variable. The destination path with trailing backslash can be a variable".So I modified the FileInstall line to the following:FileInstall("C:\Program Files\AutoIt3\Extra\Editors\TextPad" & "\Scrrun.Dll", @SystemDir & "\Scrrun.Dll")Different error Message: Error Adding File.C:\Program Files\AutoIt3\Extra\Editors\TextPad (My ScriptDir right now)So I modified it again to this:FileInstall( "C:\Program Files\AutoIt3\Extra\Editors\TextPad\Scrrun.Dll" , @SystemDir & "\Scrrun.Dll") Compiled with no errors. The compiled script ran OK. Problem solved! (IMHO)Lesson learned: Be sure not to use a variable as the source in FileInstall function?I feel that this has been a good first day for me with AutoIt3.It's good to have a simple, non-critical (to me), no immediate need, type of problem to learn with. Thanks for the opportunity to learn and to contribute. Test was done on WIN98SE and AutoIt3, version is 3.0.94.0 Hope this was helpful.............good luck, Bob Link to comment Share on other sites More sharing options...
Administrators Jon Posted February 25, 2004 Administrators Share Posted February 25, 2004 I've not been this scared by an avatar since Larry's blinking eye. Deployment Blog:Â https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming:Â https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Valik Posted February 25, 2004 Share Posted February 25, 2004 So I modified the FileInstall line to the following:QUOTE FileInstall("C:\Program Files\AutoIt3\Extra\Editors\TextPad" & "\Scrrun.Dll", @SystemDir & "\Scrrun.Dll") Different error Message: Error Adding File.C:\Program Files\AutoIt3\Extra\Editors\TextPad (My ScriptDir right now)So I modified it again to this:QUOTE FileInstall( "C:\Program Files\AutoIt3\Extra\Editors\TextPad\Scrrun.Dll" , @SystemDir & "\Scrrun.Dll") Compiled with no errors. The compiled script ran OK. For the same reason you can't use a variable in the source path, you also can't use the concatenation operator: the compiler (or interpreter in the case of uncompiled scripts) doesn't know about variables or operators or anything of that nature. It has to be a pure string literal, no concatenation, no variables, nothing but a valid path in string format. Link to comment Share on other sites More sharing options...
sykes Posted February 25, 2004 Share Posted February 25, 2004 I've not been this scared by an avatar since Larry's blinking eye. No Doubt about that Jon We have enough youth. How about a fountain of SMART? Link to comment Share on other sites More sharing options...
BobHansen Posted February 25, 2004 Share Posted February 25, 2004 I've not been this scared by an avatar since Larry's blinking eye.Mommy luvs me! Hope this was helpful.............good luck, Bob Link to comment Share on other sites More sharing options...
scriptkitty Posted February 25, 2004 Share Posted February 25, 2004 I admit it is a bit freaky, but I keep seeing Tiotua every time i look at Jon's. AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
jpm Posted February 26, 2004 Share Posted February 26, 2004 "TIOTUA"Isn't that almost phonetic for "TORTURE"?Lar.if not french?That' vs a japanese prononciation of a french word Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now