File Install Directory

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Thenatan
Posts: 38
Joined: 01 Sep 2018, 16:28

File Install Directory

16 Sep 2018, 06:42

Hey Folks .

I'm Trying To Make My Script Installation Path In Program Data , And Also Install Each File In Their Own Folder , Can You guys Give Me Some Examples?

Code: Select all

FileCreateDir,C:\ProgramData\My Script  ;<<<< Parent Folder
FileCreateDir,C:\ProgramData\Myscript\Resources   ;<<<< New Folder Inside The Parent Folder
FileCreateDir,C:\ProgramData\My Script\Files    ;<<<< New Folder Inside The Parent Folder

SetWorkingDir,C:\ProgramData\My Script

FileInstall,Resources\BackGround.png,%A_WorkingDir%\BackGround.png,1   ;<<<<< Can't Place The Png Files In Their Own Folder
FileInstall,Files\Example.txt,%A_WorkingDir%\Example.txt,1   ;<<<<< Can't Place The Png Files In Their Own Folder

Any Help Would Be Appreciated , Thank You
garry
Posts: 1505
Joined: 22 Dec 2013, 12:50

Re: File Install Directory

16 Sep 2018, 07:30

example worked ( maybe can use also filecopy for this ? )

Code: Select all

;- note creates C:\ProgramData22  with subfolders

#warn
setworkingdir,%a_scriptdir%
fd1:="C:\ProgramData22\My Script"
fd2:="C:\ProgramData22\My Script\Resources"
fd3:="C:\ProgramData22\My Script\Files"
ifnotexist,%fd1%
  FileCreateDir,%fd1%
ifnotexist,%fd2%
  FileCreateDir,%fd2%
ifnotexist,%fd3%
  FileCreateDir,%fd3%
;return
  
aa:= fd1 . "\background.png"
bb:= fd1 . "\Example.txt"

Fileinstall,C:\ProgramData22\My Script\Resources\Background.png,% aa,1
FileInstall,C:\ProgramData22\My Script\Files\example.txt, % bb,1
try
run,%fd1%
return

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], CyL0N and 58 guests