# EzSkin Folder Error

## Recommended Posts

Ok, first off, I'm 2 days into autoit, so my methods and GUI may not be very pro, but I ran into a problem where once my script is compiled and working with an EzSkin, it will not run unless that EzSkin folder is still present in the same directory my script is run from.

My (possibly stupid) idea is that I would have to create an installer script that would make a path with _PathFull, and install my real script into it and Create a folder next to my script called EzScript. And then use a FileInstall in that installer script to include and place my images for ezscript into the ezscript folder. Also then I would use FileCreateShortcut to make shortcuts in the start menu and on the desktop which would then run my script directly. Is this a retarded way to go about it? And if not how would such a program look?

My current Code(my first script/GUI ever) is no longer attached below =P Please any help on this would be great.

Edited by Imperial1

##### Share on other sites

Ok, first off, I'm 2 days into autoit, so my methods and GUI may not be very pro, but I ran into a problem where once my script is compiled and working with an EzSkin, it will not run unless that EzSkin folder is still present in the same directory my script is run from.

My (possibly stupid) idea is that I would have to create an installer script that would make a path with _PathFull, and install my real script into it and Create a folder next to my script called EzScript. And then use a FileInstall in that installer script to include and place my images for ezscript into the ezscript folder. Also then I would use FileCreateShortcut to make shortcuts in the start menu and on the desktop which would then run my script directly. Is this a retarded way to go about it? And if not how would such a program look?

My current Code(my first script/GUI ever) is attached below. Please any help on this would be great.

Or should I

$ezscriptfolderPath = _PathFull( @ScriptDir & "\EzScript\" )$destination = @ScriptDir & "\EzScrip\somefile.bmp"

FileInstall("C:\Gumpatchv3\somefile.bmp", $destination)$destination = @ScriptDir & "\EzScrip\somefile1.bmp"

FileInstall("C:\Gumpatchv3\somefile1.bmp", $destination) And then in my exit function put DirRemove( @ScriptDir & "\EzScript" , 1 ) ???? Edited by Imperial1 #### Share this post ##### Link to post ##### Share on other sites I mean :$ezskinfolderPath = _PathFull( @ScriptDir & "\EzSkin\" )

$destination = @ScriptDir & "\EzSkin\somefile.bmp" FileInstall("C:\Gumpatchv3\somefile.bmp",$destination)

$destination = @ScriptDir & "\EzSkinsomefile1.bmp" FileInstall("C:\Gumpatchv3\somefile1.bmp",$destination)

And then in my exit function put

DirRemove( @ScriptDir & "\EzSkin" , 1 )

I totally just noticed that in all these posts I put EzScript where I meant to Say EzSkin in all cases sorry if I confused anyone.

Edited by Imperial1

##### Share on other sites

Or should I

$ezscriptfolderPath = _PathFull( @ScriptDir & "\EzScript\" )$destination = @ScriptDir & "\EzScrip\somefile.bmp"

FileInstall("C:\Gumpatchv3\somefile.bmp", $destination)$destination = @ScriptDir & "\EzScrip\somefile1.bmp"

FileInstall("C:\Gumpatchv3\somefile1.bmp", $destination) And then in my exit function put DirRemove( @ScriptDir & "\EzScript" , 1 ) ???? FileInstall("C:\Gumpatchv3\EzScript\", @ScriptDir & "\EzScript\") on exit use DirRemove(@ScriptDir & "\EzScript\") 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!" #### Share this post ##### Link to post ##### Share on other sites Sorry for my Crazy rant..... I solved by adding this code: Func OnAutoItStart () DirCreate ( @ScriptDir & "\EzSkin" )$destination = @ScriptDir & "\EzSkin"
FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\1.bmp" , $destination & "\1.bmp" , 1) FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\2.bmp" ,$destination & "\2.bmp" , 1)
FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\3.bmp" , $destination & "\3.bmp" , 1) FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\4.bmp" ,$destination & "\4.bmp" , 1)
FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\5.bmp" , $destination & "\5.bmp" , 1) FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\6.bmp" ,$destination & "\6.bmp" , 1)
FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\7.bmp" , $destination & "\7.bmp" , 1) FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\0.bmp" ,$destination & "\0.bmp" , 1)
FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\list.bmp" , $destination & "\list.bmp" , 1) FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\normal.bmp" ,$destination & "\normal.bmp" , 1)
FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\press.bmp" , $destination & "\press.bmp" , 1) FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\over.bmp" ,$destination & "\over.bmp" , 1)
FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\sleek1.bmp" , $destination & "\sleek1.bmp" , 1) FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\sleek2.bmp" ,$destination & "\sleek2.bmp" , 1)
FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\skin.dat" , $destination & "\skin.dat" , 1) EndFunc Func OnAutoItExit ( ) DirRemove( @ScriptDir & "\EzSkin", 1) EndFunc #### Share this post ##### Link to post ##### Share on other sites looks nice! Maybe just add 1 more button to the bottom right side. This will look nicer and more even visually. Also you can make that button about you, the author/program!!! 8) #### Share this post ##### Link to post ##### Share on other sites FileInstall should also work with just the folder name but I forgot that the folder must already exist so It would be DirCreate(@ScriptDir & "\EzSkin\") FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\",$destination & "\")

NOTE that when using FileInstall with Folders then you need the trailing backslashes.

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!"

##### Share on other sites

FileInstall should also work with just the folder name but I forgot that the folder must already exist so It would be

DirCreate(@ScriptDir & "\EzSkin\")

FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\", $destination & "\") NOTE that when using FileInstall with Folders then you need the trailing backslashes. Yeh I actually tried to Use FileInstall for the folder iteself, and couldn't get it to work. Obviously, it must have been because that folder did not already exist. Either way, even though I already went the long route I will try this now since 1 copy operation is better than 14 xD. Thanks for the input, and also at Val... I plan to add more buttons, like alot. But I will probably change buttons into combo boxes or drop down list or radio buttons on some, I just need to add more to my skill set first. A Table of Push Buttons is pretty boring imho but its the only way I could figure out how to do it. One option I was thinking to do was to use check boxes, and then 1 button to call a function which "starts" a series of IF, THEN statements which use the GUICtrlGETState and GUICtrlRead commands. But first I need to learn how to use GUICtrlGetState correctly and efficiently, so that I dont have redundant/repating code throughout my script. I have a Goal to keep the compiled EXE under 400kb when it is complete. EDIT: Final Code I used to accomplish this task was Func OnAutoItStart () DirCreate ( @ScriptDir & "\EzSkin" )$destination = @ScriptDir & "\EzSkin"
FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\" , $destination & "\" , 1);~only edit the source EndFunc Func OnAutoItExit () DirRemove( @ScriptDir & "\EzSkin", 1) EndFunc Thanx guys for all your help. EDIT: ouch I Lied this didnt work when I went to compile, seems its a compiler bug rather than the scripting engine though. Edited by Imperial1 #### Share this post ##### Link to post ##### Share on other sites Yeh I actually tried to Use FileInstall for the folder iteself, and couldn't get it to work. Obviously, it must have been because that folder did not already exist. Either way, even though I already went the long route I will try this now since 1 copy operation is better than 14 xD. Thanks for the input, and also at Val... I plan to add more buttons, like alot. But I will probably change buttons into combo boxes or drop down list or radio buttons on some, I just need to add more to my skill set first. A Table of Push Buttons is pretty boring imho but its the only way I could figure out how to do it. One option I was thinking to do was to use check boxes, and then 1 button to call a function which "starts" a series of IF, THEN statements which use the GUICtrlGETState and GUICtrlRead commands. But first I need to learn how to use GUICtrlGetState correctly and efficiently, so that I dont have redundant/repating code throughout my script. I have a Goal to keep the compiled EXE under 400kb when it is complete. EDIT: Final Code I used to accomplish this task was Func OnAutoItStart () DirCreate ( @ScriptDir & "\EzSkin" )$destination = @ScriptDir & "\EzSkin"
FileInstall("C:\Documents and Settings\Home\Desktop\EzSkinz\" , \$destination & "\" , 1);~only edit the source
EndFunc

Func OnAutoItExit ()
DirRemove( @ScriptDir & "\EzSkin", 1)
EndFunc

Thanx guys for all your help.

EDIT: ouch I Lied this didnt work when I went to compile, seems its a compiler bug rather than the scripting engine though.

Actually the more I read that help page the more I'm thinking that the source can not be a folder.

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!"

##### Share on other sites

Actually the more I read that help page the more I'm thinking that the source can not be a folder.

true, I have always included files individually!

8)

## Create an account

Register a new account

×

• Wiki

• Back

• Git