kjpolker Posted October 13, 2009 Share Posted October 13, 2009 I am not entirely sure on how to use the FileInstall script, I tried help file but it was just not enough information for me. I will show you what the source and destination will be and how I want it to work but I could use help on actually writing this, please don't just write this and have me take it cause I will not learn the command, I want an explanation of what happened and why if you could please. Ok so my files I want installed are actually icon and a jpg image, the destination of them are all: M:\USER\Autoit\PROJECT\Icons\image1.ico M:\USER\Autoit\PROJECT\Icons\image2.ico M:\USER\Autoit\PROJECT\Icons\image3.ico M:\USER\Autoit\PROJECT\Icons\image4.ico M:\USER\Autoit\PROJECT\Icons\image5.ico M:\USER\Autoit\PROJECT\Icons\Image6.jpg Now I want them installed the folder of my program, but obviously if other people are using my program their path to the folder is not the same as mine (user names arent same, possibly the drive may not be the same) so how can I make it so it puts it in the folder without determining the entire path? I want these images than used in my script that it why I am trying to learn this. Thank for help hope to hear soon! Link to comment Share on other sites More sharing options...
Zedna Posted October 13, 2009 Share Posted October 13, 2009 FileInstall() it to some helper pdirectory first. That directory will be the same on all machines. After that use FileMove() to move it to users directory. This way FileInstall() can use always the same path (not variable) and variable path will be used in FileMove(). Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 13, 2009 Share Posted October 13, 2009 Am I missing something? You are allowed to use variables and macros like @ScriptDir in the DESTINATION of a FileInstall(). Only the source has to be a valid literal path at compile time. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
kjpolker Posted October 13, 2009 Author Share Posted October 13, 2009 So if I throw in FIleInstall() at the beginning of my script and use my path of the image, and a random path for the destination, it will pull the file at the time of Compile and at startup of the program (no matter what computer) it will than throw it in the desired destination? Do I than have to make a config.ini file and have the user define where the folder of my program is? Or can it be much simpler than that? Link to comment Share on other sites More sharing options...
Chris86 Posted October 13, 2009 Share Posted October 13, 2009 (edited) FileInstall("M:\USER\Autoit\PROJECT\Icons\Image6.jpg", @Scriptdir & "\Icons\image6.jpg") (I think you have to create that folder first) It's more simple to use Macros like @DesktopDir, @Documentsdir, @HomePath, @HomeDrive Check out Macro Reference in Help File Edited October 13, 2009 by Chris86 Link to comment Share on other sites More sharing options...
kjpolker Posted October 13, 2009 Author Share Posted October 13, 2009 (edited) Thank you so much! Edited October 13, 2009 by kjpolker 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