PDA

View Full Version : Error: Can't write the file


Brave Heart
04-29-2007, 09:37 AM
Hi

I'm currently working on a project with flash files saved as exe not swf. After publishing the project on CD
I got this error "Flash in a shell Error: Cant write the file".

I get this error when I only run the project from the CD, but when I run it from the computer it works properly.

And also it runs properly if it is published as EXE file, even it is run from the CD. If I use the EXE format, my project will be very slow because there are many files included.

How can I solve the problem?

a sample from my project and the error screenshot are attached.


Thanks

Brave Heart
04-29-2007, 11:47 AM
Sorry, here is the screenshot of the error.

RizlaUK
04-29-2007, 01:26 PM
your flash file is trying to write a file on the cd, which it cant

i dont know how the flash exe thing works, but it seems that its trying to write a file, maybe it needs this file to run, settings or something like that

try copying the file to a temp folder and run it from there so it can write the file to the hdd and not the cd

Brave Heart
04-29-2007, 01:57 PM
Thanks RizlaUK,

As I said before, when I run the project directly from the hdd it works without problems. The problem only occurs when I copy the project and run it from the CD. And this problem doesn't occur if the project is published as EXE even if I run it from the CD.

Any suggestion?

Thanks

RizlaUK
04-29-2007, 03:12 PM
like i said above, try copying the file to a temp folder and run it from there so it can write the file to the hdd and not the cd


File.Copy(_SourceFolder.. "\\file.exe", _TempFolder.. "\\file.exe", true, true, false, true, nil);
err= Application.GetLastError();
if (err ~= 0) then
Dialog.Message( "Error", _tblErrorMessages[err], MB_OK, MB_ICONEXCLAMATION);
else
result = File.Run(_TempFolder.. "\\file.exe", "", _TempFolder, SW_SHOWNORMAL, false);
end

output enhanced with AMS Code Pretty (http://www.indigorose.com/forums/showthread.php?t=19409)

Brave Heart
04-29-2007, 03:26 PM
Thanks for your reply and sorry to bother you.

Where should I put the code?

and if I have 20 files, will it be the same code for all files?

Thanks

RizlaUK
04-29-2007, 03:55 PM
yes, just change the path and filename for each file

if you give more detail i can help more,

how are you launching the files.....listbox....button....???

Brave Heart
04-30-2007, 02:08 AM
I have a seperate page for each file with a button
in each page to launch the files.

And I use Quick Action "Run Program"
AutoPlay\\Docs\\ABC_song\\abc_song.exe

and the working folder:
AutoPlay\\Docs\\ABC_song


Thanks

Brave Heart
04-30-2007, 02:26 AM
like i said above, try copying the file to a temp folder and run it from there so it can write the file to the hdd and not the cd


File.Copy(_SourceFolder.. "\\file.exe", _TempFolder.. "\\file.exe", true, true, false, true, nil);
err= Application.GetLastError();
if (err ~= 0) then
Dialog.Message( "Error", _tblErrorMessages[err], MB_OK, MB_ICONEXCLAMATION);
else
result = File.Run(_TempFolder.. "\\file.exe", "", _TempFolder, SW_SHOWNORMAL, false);
end

output enhanced with AMS Code Pretty (http://www.indigorose.com/forums/showthread.php?t=19409)



Hi again

I tried this code one one file and I got the same error
but this time also even when I run the file from the HHD :huh

TristanD
04-30-2007, 02:27 AM
are you sure that its not write/read protected?

Brave Heart
04-30-2007, 03:13 AM
Yes, it is not write/read protected.

Brave Heart
04-30-2007, 01:43 PM
Plz, any idea to solve the problem?

RizlaUK
04-30-2007, 02:08 PM
the example you posted has "abc_song.exe" and also has a directory called "Data", the files in the Data directory are the support files for the flash exe file, you will need to copy that directory to the temp folder as well

here, i took your files and put then into a zip file,

this will extract the zip to a temp folder and run the exe

Brave Heart
05-01-2007, 02:50 PM
Thanks RizlaUK,

everything is working well now. :yes :)

RizlaUK
05-01-2007, 02:59 PM
no problem, glad you got it in the end :yes