This is a pre-sales question. I haven’t even downloaded HTMLExe to try it yet, hoping to get this answered first…
Is there any way during either startup or display of the ebook, that it can display the user’s activation code?
I would like either a splash screen or panel at the bottom of the viewer, etc., to display something like “Licensed to James C. Doe”. We feel it is a great deterrent to unauthorized copying to have the user’s name embedded in the activation code, but without the hassles of online access to an activation server.
(We’re software developers, so if the solution involves some scripting, etc., we’re up for that…)
You can retrieve the user name or his activation code with HEScript. Then, it’s up to you to display it where you want, for instance in your index page or in the status bar for instance.
Some code that you may use to store the registered user name in a global variable:
if GetGlobalVar("hepubregistered", "0") = "1" then
begin
S := GetGlobalVar("hepubuserdata1", "");
if S <> "" then S := " (" + S + ")";
S := GetGlobalVar("hepubusername", "") + S;
SetGlobalVar("RegisteredUser", "Licensed to " + S), false);
end
else
begin
SetGlobalVar("RegisteredUser", "Not licensed", false);
end;
end;
Can these techniques be used to display this information in either the Start Prompt message or the Please Wait dialog box?
I’m trying to figure out how/where to display it so that the licensed/registered user readily understands that if he passes a copy to someone else, his name & registration code will appear prominently…identifying the copy as one licensed to him/her.
Or where would you suggest is the best place/opportunity to show this information? Maybe on the Index page, as you mentioned?
You can’t display it in the “Please wait” dialog box, because registered user info is not loaded at this time. However, it’s possible to display a message box at startup, something like “Program licensed to …, distribution is prohibited”.
The index page is a good place in my opinion. The about box too, but HTMLExe already inserts the name of the registered user in the about box.
I am new to scripting but would like to be able to do it!
Could someone please tell me exactly (code and instructions) how to display the user name and registration key on the front page of my book. I have tried to make sense of the help section but cannot get the data to display using any of the suggestions in the help text.
This is the script I am using (based on above posts in this section, with corrected syntax):
procedure Details;
var
S: string
begin
if GetGlobalVar(“hepubregistered”, “0”) = “1” then
begin
S := GetGlobalVar(“hepubuserdata1”, “”);
if S <> “” then S := " (" + S + “)”;
S := GetGlobalVar(“hepubusername”, “”) + S;
SetGlobalVar(“RegisteredUser”, "Licensed to " + S, false);
end;
else
begin
SetGlobalVar(“RegisteredUser”, “Not licensed”, false);
end;
end;
I set this up in User Scripting as “test” and tried using hescript://test.Details as an html link and also tried calling in the script with javascript routines but just cannot get the info to display. I am, of course using a registered version of my book to test this so the registered name and registration key are available.
The first line calls your test.Details HEScript procedure that creates the RegisteredUser variable.
The second line writes the value of RegisteredUser into the HTML document.
This is line 9:
9 document.write(window.external.GetGlobalVariable(“RegisteredUser”));
Also,
Can you please tell me the name of the global variable assigned to the registration key so I can attempt to modify the script to call both the user name and the registration key? If you have the time to suggest how the script could be modified to call up both variables that would be wonderful.
And for the activation code, modify the first script like this:
procedure Details;
var
S: string
begin
if GetGlobalVar("hepubregistered", "0") = "1" then
begin
S := GetGlobalVar("hepubuserdata1", "");
if S <> "" then S := " (" + S + ")";
S := GetGlobalVar("hepubusername", "") + S;
SetGlobalVar("RegisteredUser", "Licensed to " + S + ", key: " + GetProperty("UserKey", ""), false);
end;
else
begin
SetGlobalVar("RegisteredUser", "Not licensed", false);
end;
end;