VMs

Hi, I hope you can solve a problem for me. I have an app that I want to allow to run on a VM. We asked about this and you said:

Using VMs on Macs if user saves the state of their VM does this in any way defeat any Lime initial 'trial period' we offer for demos? Yes, it effects the "unverified" (client side) trial functionality in TurboActivate. The way to use trials in Virtual Machines is to first detect if you're in a VM (call UseTrial() with the TA_DISALLOW_VM flag and it will return TA_E_IN_VM if you're in a VM) and if you're in the VM then use the custom license fields for the trial. Also, ping your server to see if the date/time is correct.

So I've set my code up to check and it fails with a Windows crash at the UserTrial function. What I'm doing is checking if activated then if not, I call UseTrial with the disallow_vm flag. Here is the code:

Try ' Check if we're activated, and every 90 days verify it with the ' activation servers. In this example we won't show an error if ' the activation was done offline. (see the 3rd parameter of ' the IsGenuine() function) gr = TurboActivate.IsGenuine(90, 14, True) '90,14 isLimeActivated = (gr = IsGenuineResult.Genuine _ OrElse gr = IsGenuineResult.GenuineFeaturesChanged _ OrElse gr = IsGenuineResult.InternetError)Catch ex As TurboActivateException MessageBox.Show("Failed to check if activated: " + ex.Message)End Try

If isLimeActivated Then 'Handles okElse TurboActivate.UseTrial(TurboActivate.TA_Flags.TA_USER Or TurboActivate.TA_Flags.TA_DISALLOW_VM) 'Handles ok on a non VMEnd if

I've also tried using

TurboActivate.TA_Flags.TA_USER Or TA_Flags.TA_DISALLOW_VM

TurboActivate.TA_Flags.TA_SYSTEM Or TurboActivate.TA_Flags.TA_DISALLOW_VM

and

TurboActivate.TA_Flags.TA_DISALLOW_VM

and I've tried with the "Allow VM Activations?" turned on and off.

What am I missing?

Neil

Hey Neil,

Either of these is correct:

TurboActivate.TA_Flags.TA_USER or TA_Flags.TA_DISALLOW_VM

or

TurboActivate.TA_Flags.TA_SYSTEM or TA_Flags.TA_DISALLOW_VM

If you're in a VM then UseTrial will throw VirtualMachineException.

Thanks, Sam. That has done it. I was using your VB.Net UseTrial function as is. I hadn't realised it needed to be wrapped in a Try/Catch to manage the error. All working now.Neil