Embedfile / RetrieveFile - getting the wrong file...

Tex8503

Active Member
Licensed User
Longtime User
So I've been trying to create my own encrypted installer and I'm most of the way there - I'm encrypting files then embedding them into one file.

Problem is that retrievefile doesn't seem to be retrieving the right file based on the file's name.

Example:
If I embed (this is how it appears in windows):
1.dat
2.dat
3.dat
manifest.txt
finalfiles.txt
settings.txt

and then try to use RetrieveFile("manifest.txt") - I'll get the data in 1.dat in a file called manifest.txt

But... if I rename manifest.txt to 1.a and it embed, it shows up in windows like this:

1.a
1.dat
2.dat
3.dat
finalfiles.txt
settings.txt

and run RetrieveFile("1.a") - I'll get the data in 1.a

Is this how this is supposed to work? I thought RetrieveFile was supposed to get the file that you were specifying? Is this not the case?
 

agraham

Expert
Licensed User
Longtime User
I thought RetrieveFile was supposed to get the file that you were specifying? Is this not the case?
No, Files are retrieved in the order they are added. You are assumed to know the order of the files. The name used on RetrieveFile does not need to match the saved filename as only the contents of the file are saved.
 
Top