You can add an IF to your start up script using the Get(ApplicationVersion) function. If it doesn't return Runtime version, have the script close the file or exit the application with or without a message to the user, you choose.
I have a list of authorized computers on which my solution can be accessed from. The start up script checks to see if the NICaddress from the computer matches an authorized computer from that table, if so it passes on. If not, it sends me an email giving me the Comptuer someone is trying to access it from and gives users a chance to enter a text explaining what computer they are on and why they need access from there.
Thank you Charlie!
* Forgot to add a caveat. You probably picked it up anyway, but for any other readers that check this thread.
In this case where you want a certain behavior for other users from a developers standpoint, you probably want to leave yourself a backdoor. If you open the file with FMPA you can use the scriptdebugger to exit the script before it boots you out, but from FMP it wouldn't be possible. So in the startup script, I have an IF to check if the user is me, if it does, it doesn't apply the tests, if not it does. This can be done, with accountname privilege set, etc...
And if you strip out the admin account from the copy you distribute (keep it in your development copy), you'll make this "back door" difficult for others to use...
I caught on to that I might lock myself out. So, I made a copy of my file before setting the start up script.
Nice to know there is a work around if I messed up.
Also, I only have guest with full privileges.
Here is my start up script:
•If [LeftWords(Get(ApplicationVersion);1) = "Runtime"]
•Show Custome Dialog ["Application Error";..... Option: Ok
•Go to Layout ["Program Form"]...
I am trying to make it look like an error instead of a security feature if someone opens it up in FMP.
I would rather the file not open at all and just the custom dialog pops up. However, if I close the
window after "Else" then the dialog cannot come up. Freezing it as I have above yields a white screen
which I can live with. Anyway, to get the window to close and only have the dialog pop up?
You can add a Window Script Step to minimize the window, then have the pop up dialog and after that exit the application.
You can also add a step to send you an email with the computer name, user name and NICaddress, or other usefull information so you know where they are trying to open your solution.
I would definitely build in the back door...