File Permissions

I am reading and writing to a file created by the eBook and all is well under XP. However, if the setup program is run under Windows 7 (administrator of course, to be able to run setup) I can’t access the file to write to (although reading is fine), when logged on as another user.

Does anyone know the Delphi/HRML Executable call to set the file permissions to read/write for anyone. I could do this at setup time if necessary.

Thanks John

It can work on Windows 7 if you do not write the file in restricted areas like C:\Program Files…
HTML Executable provides you with a storage folder where you are sure that you can always write and read data for your publication.
The location to the storage folder is available in the HEPubStorageLocation variable.
See the doc at: and

Thanks support, I will test this.


Hi Support. thanks for your help.

Your solution works fine but this was part of a larger problem.

The data in the file mentioned above is used by the eBook and is read and written by the user at any time.

Now, when we upgrade their system say from version 12 to version 13 we will want to save their date from the previous version to be used in the next. I can create javascript buttons to save and retrieve the files OK but I am having problems knowing where to put them (in some sort of common or shared area that both versions have read/write access to) so that they are available to both versions. The storage area you mentioned is not used when a new version is loaded and the HEPublicationPath is not writeable by a non-administrative user.

This problem only applies to users running the eBook who are not administrators. Any answer to this or any other solution gratefully accepted.

Hope that makes sense.

Many thanks


You can change how HEPublicationPath is configured. It’s in the “Deployement” page:

In your case, I suggest that you use the same location for both versions. Thus, they will share the same data.

Many thanks again, support.

From the page you linked it says -

Does this mean that clients who are accessing the eBook from a windows 7 user which is not set up with administrator rights, will be able to read and write to files in this area?

Does it also mean that the distributed version we sell has to be installed as a ‘Portable’ version?

Thanks John

Sorry to confuse you, your quote is only for portable publications. AFAIK, you are not making a portable publication, so the storage folder is on the end user’s hard drive, at a writeable place.
I used this link because in case you are making a portable publication, data is written in the same folder as the EXE file (that’s normal: a portable publication shouldn’t write data on the end user’s computer, but on the device where it is stored, like a USB stick).
But in your case, you don’t make a portable pub, so it won’t happen: the publication will store its data into the storage folder. HTMLExe gives you an option to change the name of this storage folder.


So the question is, is there a folder somewhere where I can write to files that is accessible to both administrator and non-administrator users? Alternatively, is it possible to change permissions on a file to make it writeable for example, in the programme folder?

The storage folder is accessible both to administrator and non-administrator users, so you shouldn’t have write issues.

Yes but when I load a new version of eBook the location will change. I need a known location (that is writeable) I can copy the notes file to from version 12 that can then be read in by version 13 to maintain continuity.

Currently they in locations like this which I don’t know how to find:

\Local Settings\Application Data\HTML Executable\UserPublication{3D2A93BF-C54A-40FD-AB4C-75E6F53E6FAB}

As I said, I need somewhere (a known location) that is writable no matter what setup is used.

I am sorry I am not explaining my self very well. Hope this is clear now.

Two alternatives:

You could use the same publication GUID for your two versions, thus the same storage folder will be used:

If you don’t want to have “HTML Executable\UserPublication{3D2A93BF-C54A-40FD-AB4C-75E6F53E6FAB}” but a custom name, like “MyFolder”, enter “MyFolder” here:

Do that for your two publications (old and new one).

I think that maybe what we are looking for.

Many thanks support.


Further to this, we need to move the created files to a place the user (who may be on a variety of systems) can read/write to even if they are not administrators and can find easily.

GDG suggested using the My Documents folder which would be ideal. Is there a preset Global Variable I can use to access this location?

No, there is no global variable yet.

The best would be calling the appropriate Windows API as described here:

Or with HEScript, you can also read registry entries (see in help):

HKEY_current_User\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell folders

you’ll find links to all the ‘special’ folders, including ‘My Documents’.

Thanks support, that works fine from the user scripting area when I do :

key := “\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders”;

ident := “Desktop”;

s := ReadRegStr(2,key,ident,-1);

But I get a javascript error, "Object doesn’t support property or method 'ReadRegStr

key =
"\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders";

ident = “Desktop”;

mydoc_path =

Am I doing something silly here?



ReadRegStr is an HEScript function, so it must be called from an HEScript script.
Please check the documentation about writing HEScript scripts, and calling them from JavaScript.