| View previous topic :: View next topic |
| Author |
Message |
Epuls56
Joined: 19 Apr 2008 Posts: 33
|
Posted: Tue Apr 22, 2008 1:57 pm Post subject: FileInstall Help... |
|
|
What is wrong with this code? It doesn't seem to work...
| Code: | #NoEnv
SetWorkingDir,%A_ScriptDir%
r::SoundPlay, 03-I'm Not Jesus
esc::exitapp
enter::reload
Fileinstall, C:\Documents and Settings\Ethen\Desktop\03-I'm Not Jesus.wav, C:\Documents and Settings\Ethen\Desktop\AHK scripts and programs\The prank files\Soundplay and fileinstall test\03-I'm Not Jesus.wav,1
|
|
|
| Back to top |
|
 |
Epuls56
Joined: 19 Apr 2008 Posts: 33
|
Posted: Tue Apr 22, 2008 1:58 pm Post subject: |
|
|
| and no thats not a satanic song. |
|
| Back to top |
|
 |
Razlin
Joined: 05 Nov 2007 Posts: 370 Location: canada
|
Posted: Tue Apr 22, 2008 2:24 pm Post subject: |
|
|
what is it thats not working?
the "joke" or the fileinstall?
fileinstall works when you Compile a script
It doesnt work if not compiled.
as per help file
| Quote: | | Includes the specified file inside the compiled version of the script. |
_________________ -=Raz=- |
|
| Back to top |
|
 |
Epuls56
Joined: 19 Apr 2008 Posts: 33
|
Posted: Wed Apr 23, 2008 12:17 am Post subject: |
|
|
| I compiled it, it compiles just fine, but it doesn't extract it back out. |
|
| Back to top |
|
 |
skwire
Joined: 18 Jan 2006 Posts: 132 Location: Conway, Arkansas
|
Posted: Thu Apr 24, 2008 12:04 pm Post subject: |
|
|
| Epuls56 wrote: | | I compiled it, it compiles just fine, but it doesn't extract it back out. |
It doesn't extract it back out because it never gets to that part of your code when you're running the compiled exe. Read the first paragraph of this section: http://www.autohotkey.com/docs/Scripts.htm#auto
So, in your code, the auto-execute section stops at this line:
| Code: | | r::SoundPlay, 03-I'm Not Jesus |
Another caveat with FileInstall is that it will not create the destination directory. It must exist for the extraction to work. Consider this example:
| Code: | #NoEnv
SetWorkingDir,%A_ScriptDir%
Destination_Dir := "C:\Documents and Settings\Ethen\Desktop\AHK scripts and programs\The prank files\Soundplay and fileinstall test"
IfNotExist, %Destination_Dir%
{
FileCreateDir, %Destination_Dir%
}
FileInstall, C:\Documents and Settings\Ethen\Desktop\03-I'm Not Jesus.wav, %Destination_Dir%\03-I'm Not Jesus.wav, 1
; End of auto-execute section
r::SoundPlay, %Destination_Dir%\03-I'm Not Jesus.wav
esc::exitapp
enter::reload |
|
|
| Back to top |
|
 |
|