I don't know that, if you provide access to the file itself (as opposed to installing it for them on FileMaker Server), you can positively prevent a user from installing the file on a mobile device. However, you can create an OnFirstWindowOpen trigger script that detects the device and simply closes the file if it's an iPad or iPhone. Here's a simple calculation I use:
Let ( [
appVer = Get ( ApplicationVersion )
PatternCount ( appVer ; "Pro" ) ; "Desktop" ;
PatternCount ( appVer ; "Go_iPad" ) ; "iPad" ;
PatternCount ( appVer ; "Go" ) ; "iPhone" ;
PatternCount ( appVer ; "Server" ) ; "Server" ;
PatternCount ( appVer ; "Web" ) ; "Web" ;
Another thought: If your intent is to prevent multiple copies from being installed, then just detecting the device won't do it, because it won't prevent someone from installing on more than one desktop computer. For that, you probably need to have a registration system that checks the license key / persistent ID against a database on your server / web site. (Which would obviate the need to check the device anyway.)
Thank you for your response. I have provided a link to a doc containing screenshot of OnFirstWindowOpen and close of Filemaker.
I am not sure if there is a better way to script this. In essence I am allowing an IPAD or IPhone to connect to a solution by remote that is open on a Mac or PC, but if the solution is directly opened from an IPAD or IPhone, where it has been installed on these devices, then to just simply exit the solution.
Any thoughts or would this method work suitably. Just getting alternative opinion and thoughts.
Thank you again in advance.
Well, a couple of thoughts:
1) You're doing more than you need to. There's no need to set a global variable ($$Device_Mode) if all you're going to do is exit the application, because as soon as you do, the variable is erased anyway.
2) I'm not sure how PREFERENCES::g_application gets set in the first place, but if this is the first script that executes, how do you ensure it gets set? If it's NOT equal to zero, then the user will be able to open the application on the mobile device. Are you relying on your exit script to do that? Not really a good practice, because he'll still be able to open it the first time.
3) And again, what measures do you have in place to prevent a user from installing the application on more than one desktop client using the same license? You'll need something besides just this.
Thanks for quick response. In answer to points.
1. Point noted and will remove global variable.
2. g_application gets set at beginning of open script. If patterncount application version = pro....set field to a 1. In essence this field is set and held while the solution has been executed on a computer. IPAD/Iphone does not have pro version of filemaker rather Go version. So only if variable has already been set to 1. When IPAD connects to computer it will see that g_application has been set to one and will not exit application. However if Solution is opened directly on IPAD then it cannot set the field g_application to 1 because I have not told it to do so in script. It will be zero.
On exit of application, if exit from computer, then set field back to a 0.
3. measures in palce is a registration number and combination calculation based on several factors with importantly persistent ID included. Solution can only be registered on one computer. Persistent ID is recorded based on calculation field. On registration of solution another text field is also set with persistent id number. On startup of solution text field must = calculation field (persistent id number). if not equat then it will exit application. This prevents a registered version being copied and used on another computer as calculation field will change persistent ID number but will no longer = original installed number recorded on text field.
So in actualy fact the license is not the same. there is only one. Even if they reinstalled it on another computer, the license is provided based on several factors provided includign the persistent ID number in combination. So this in turn will not allow whomever to use the same registration key on a different computer as it will nto work. Further in the event that the cliebnt advised that it had been reinstalled on a different computer, then I would disbale to old registration number and provide them a new one. The solution I have will check the internet whether a registration number is on a banned list. It works and is the best solution I have thought of not having a FM server.
If you have registration scheme in place, then there should be no need for any of this messing around with detecting the device, right? The persistent ID won't match, so they get kicked out.
And just for calculation purposes ... unless you explicitly set a field to 0, empty doesn't equal 0. So that calc may still blow up on you. I don't see a need for the g_application field at all. Unless it serves some purpose other than verifying the device.
I forget to mention....the registration process goes one step further. If it detects an invalid match, then it will reset the solution back to demo version if zero days left on the solution. An email is sent to me on notification and I provide support where required. However if the reset is as a consequence of installation on different computer then they will still get in touch mentioning that they cannot re-register with current registration ket that they have. This in turn will allow me to understand what they have done..ie reinstalled on a new computer, I will issue them with new registration key and further it allows me to ban old number. Without the reset process in place, can provide ample tendencies to continue to do things in contravention of terms and conditions.
For the clienttelle range I have then number of times a reset would occur would only arise if they got a new computer in which case I would provide a new registration number free of charge.
If it is not reset to Demo mode then what you say would be correct, but I have put in place for specific secure reasons that it does reset when persistent ID is in place. In thought now as well......it hits me that another reason I have put it in place is to ensurfe that only the true person who purcahsed it can install it as they have paid good money for it.
the g_application field is set to 0 on open and set back to zero on close. I will change the field from global to normal text field. This in turn will retain the 0 as a data entry for the next time the solution is start up.
Further if the connection is by remote IPAD or Iphone then the persistent ID check is not performed. This is only performed when starting the solution up directly from a computer.
Hence why I want to allow the client to be ab=le to remote connect to the computer but NOT install on IPAD and startup direct on IPAD
I believe the approach I have taken will work but taken onboard some of your comments and made the necessary amendments.
You could check for
- PatternCount ( Get ( ApplicationVersion ) ; "Go" ) AND Get (NetworkType) = "0"
The new Get (NetworkType) function introduced in v13 returns a zero is the file is local to the device running Go.
This is great news. Good new function and glad it was introduced in FMP13. Now I can omit the setting of fields in my script on open or close of database and no need to be specific to IPAD or iPhone. Saves any chance of risk arising.
Really appreciate this information. Thank you.
Yeah, 13 introduced several new functions, a couple of which aren't even listed in the built-in Help System! A serious oversight in my opinion.