Page 1 of 1

The system cannot find the file specified

PostPosted: Sat Sep 24, 2011 12:45 pm
by wzp
I got problem, when I publish compiled exe and move to another PC, and to run any command I get error - "Error The system cannot find the file specified". So how can I compile external windows applications (.exe or .bat files) so that they can run on any other place I mean PC ?

(p.s. Im creating software that is going to convert wav to mp3 files so I need to compile small wav2mp3.exe file with gui that i created in Neo)

PostPosted: Sat Sep 24, 2011 1:16 pm
by dec
Hi,

Repeat with me: "Never, never, never use a file path that only exists on my computer". But don't worry: this is a common need and have almost two basic solutions.

1º Refer to your publication directory

NeoBook provide a global variabled named "[PubDir]", wich ever contain the directory path of your publication executable file. So, if you need to read a file containing on a subfolder "documents" placed on your publication executable file folder, you never refer to this file using the path on your computer, but doing something like this:

Code: Select all
SetVar "[MyDocPath]" "[PubDir]documents\mydoc.txt"


So dont matter where your publication is, on what computer, in a disk, a USB, a CDROM, etc. You ever can use "[PubDir]documents\mydoc.txt" to refer to a "mydoc.txt" file, under "documents" subfolder of your publication executable file folder.

2º Use the Windows "common" directories

You also may need to know where some common files an folder are placed. And you cannot assume that Windows main directory is ever on "C:\Windows", because some people can install Windows (rarelly, but possible) in other unit, for example "D:\Windows".

NeoBook also provide a global variable for this directory: "[WindowsDir]". So you can use this variable in order to know where the Windows directory is. Another variables are availables, like "[TempDir]", "[SystemDir]", etc. (you can view the NeoBook help, looking for Global variables > Folders) in order to know the path for various Windows common directories.

Hope this can help you in some way. ;)

PostPosted: Sat Sep 24, 2011 2:21 pm
by wzp
Well I dont want that those external files to be as part of main exe, can they be all compiled like text, pictures files inside compiled exe from Neo?

PostPosted: Sun Sep 25, 2011 1:54 am
by dec
Hi,

Take a look at the NeoBook help section "Embedded Files" and, in general, search the help with the "embedded" query word.

PostPosted: Sun Sep 25, 2011 2:35 am
by smartmedia
Hi..

In general, read the help, at most of the times you will find your answer there. Help is written in very simple way and if you are in the beginning learning NB could be very useful.

PostPosted: Mon Sep 26, 2011 10:36 am
by Neosoft Support
Well I dont want that those external files to be as part of main exe, can they be all compiled like text, pictures files inside compiled exe from Neo?


An exe file must be visible to Windows in order to run. The exe must be extracted at least temporarily while it is running.