Embedded files - Forum

Forum Navigation
You need to log in to create posts and topics.

Embedded files

I am having great difficulty with embedding a text file within the compiled .exe package

The help file is not clear about what exactly you should do....  or maybe it is ??

I am working on  a simple app that reads & writes data to a text file. I also use this text file to license the app.

The app is intended to run from a USB stick not via an installation.

If any user opened the text file they could easily work out how to scam the app.

So I was trying to work out a way to do this, when I came across the [embedded] command.

Which, as I understand, allows me to compile the text file within the publication during its compilation ?

So I changed all the action read & write statements from [PubDir] to [embedded]. This gave “Unknown error #123” for every read & write action

Then I added the text file using the “Embedded files” option via the “App” menu …. I recompiled …Exactly the same errors

I assumed that I must have to check “use relative path & wild cards” box.. ..  I recompiled… it just goes on compiling forever but never actually compiles

So I thought that I must have to add a path first option "."  “file pattern for embedding”  what does this mean  ??   is this the reason for not compiling ??

“Path for embedding”    what should this be ??  The help file does not describe this process.

The app works fine with the text file in the same folder  & mostly works within Neo using the “Run” option.

But once the compiled "exe" version is used on external USB stick the app clearly cannot find the text file

I’ve spent hours on this issue………Where am I going wrong ??

(All the images associated with the app are automatically embedded without any embed commands ?)

Any help would be most appreciated !   (VisualNeo for Windows  v 21.7.4)

 

 

Hello,

Take a look at "FileToVar":

https://winhelp.visualneo.com/Files1.html#FILETOVAR

But you can not write to embedded!

Regards

Hans-Peter

Thank you for responding Hans,

Are you saying that you cannot write to an embedded text file  ?

Or are you advising that there is a write restriction with regards to "FileToVar":

If it is not possible to write to an embedded  .text file... .. then that answers my problem.

From the help page:

"You can use embedded files most places in your publication just as you would in a normal disk-based file. Simply replace the file's original path with the special embedded file variable. For example:

[Embedded]Sample.jpg

From this statement I assumed that one could read & write to an embedded file.

Back to the drawing board then !

Thanks again

 

Hello,

Yes, embedding is read-only. It is not possible to change an exe without an compiler.

Also does windows not allow to change files in program-path.

So the help file is not clear or right at that page.

When you need secure storage the lately added protected zip feature might be interesting.

Then you can hold your data in your own data file in the document folder.

Or you put the data-file besides the exe on your usb-stick.

Regards

Hans-Peter

Hello,

Thanks for verifying that Hans. . ...    .  I thought it was to good to be true !

I'll take a look at the protected zip feature.

regards

Scott

Quote from Scott_Chegg on August 27, 2021, 5:25 pm

I am working on  a simple app that reads & writes data to a text file. I also use this text file to license the app.

The app is intended to run from a USB stick not via an installation.

If any user opened the text file they could easily work out how to scam the app.

Have you tried encrypting the text strings in the file?
You can make your program read a line of text, decrypt it, do its work, and later re-encrypt it to write it to the text file.

 

Greetings.

Jose.

Hello,

Jose, thanks for the suggestion ... I think it is the only way to do it, or I maybe  have a text license file which will be thousands of random characters, create a key generator & store the license data at pre determined grid points.

After all....its not bank security that's going on here  !

Hello,

There is never only one way to do something.

When you put your info file in a AES encrypted zip, you will have high end bank security.

And this is out of the box.

For your text encryption you would need a plugin.

Doing something in neoscript might be not very performant.

Anyway, your choice.

Regards

Hans-Peter

 

luishp, Vadim and CN_Iceman have reacted to this post.
luishpVadimCN_Iceman