DeAgent Posted February 7, 2010 Share Posted February 7, 2010 (edited) I am creating the installer for a program of mine but I've ran into a problem.It is called AutoCalcInstall.Exe and I want to copy it to the C: driveor any other drive that the user wants.This is the problem when I writeFileCopy("AutoCalcInstall.Exe","C:\")and try to execute the file it gives me (File "C:\Documents and Settings\Owner\My Documents\AutoIt\AutoCalcInstall.exe"):Error: Error in expression.I do not know what the problem is it should work.Can someone help me? Edited February 7, 2010 by DeAgent Link to comment Share on other sites More sharing options...
Richard Robertson Posted February 7, 2010 Share Posted February 7, 2010 AutoCalcInstall.exe is in the same folder as the script right? Link to comment Share on other sites More sharing options...
DeAgent Posted February 8, 2010 Author Share Posted February 8, 2010 AutoCalcInstall.exe is in the same folder as the script right?It is the script in exe form. Link to comment Share on other sites More sharing options...
Richard Robertson Posted February 8, 2010 Share Posted February 8, 2010 Windows doesn't like it when programs access files that are currently in use. That is most likely the problem. Link to comment Share on other sites More sharing options...
martin Posted February 8, 2010 Share Posted February 8, 2010 (edited) Windows doesn't like it when programs access files that are currently in use. That is most likely the problem. No, that's not correct. If you compile this and run this from somewhere which is not c:\ then it will work. msgbox(252144,"hi","It's me") filecopy(@ScriptFullPath,"C:\installself.exe") We need to know exactly what the error reported is to start with, and what the line used to make the copy is. (It can't be FileCopy("AutoCalcInstall.Exe","C:\") if the user can choose the destination path.) Maybe the destination path does not have the correct quotation marks around it to allow for spaces in the path. Is the error really (File "C:\Documents and Settings\Owner\My Documents\AutoIt\AutoCalcInstall.exe"): Error: Error in expression. ? Edited February 8, 2010 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
GEOSoft Posted February 8, 2010 Share Posted February 8, 2010 $sFile = "AutoCalcInstall.Exe" FileCopy($sFile,"C:\" & $sFile) George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
DeAgent Posted February 8, 2010 Author Share Posted February 8, 2010 $sFile = "AutoCalcInstall.Exe"FileCopy($sFile,"C:\" & $sFile)Thank U I will try this! 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