Jump to content
Sign in to follow this  
kjpolker

FileInstall Help please!

Recommended Posts

kjpolker

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!

Share this post


Link to post
Share on other sites
Zedna

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().

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
kjpolker

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?

Share this post


Link to post
Share on other sites
Chris86

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 by Chris86

Share this post


Link to post
Share on other sites
kjpolker

Thank you so much!

Edited by kjpolker

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.