Run OS command, License Sys

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 15/10/2011 at 23:55, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   10.5 
Platform:   Windows  ;   
Language(s) :   C.O.F.F.E.E  ;

---------
Hi

Is it possible to run Operating System Command and get the result using coffee?

If not, how can i handle releasing demo plugin and key to full version?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 16/10/2011 at 03:25, xxxxxxxx wrote:

This would be very unsafe.
Someone would just need to replace the executable with one that does always end with the result needed for activation.

The best way to protect COFFEE Plugins IMHO is to use an algorithm that is unknown to others which determines if a License Key fits to a specific Cinema 4D Key.
See this example:

createLicense() {  
  var c4dLicense  = SysGetUserInfo(0);  
      c4dLicense  = evaluate(strmid(ser,6,5));  
        
  var licenses    = new (array, 3);  
      licenses[0] = int(Modulo(ser*(pow(ser/1242,3)),979975));  
      licenses[1] = int(Modulo(ser*(pow(ser/8951,3)),457382));  
  // ...  
  return licenses;  
}

Which might evaluate to a serial like this: 8616 - 121 - 8913

Use this function to create the license, and also to check it.

var userL       = getLicenseEnteredByUser();  
var correctL    = createLicense();  
var i           = 0;  
for(i = 0; i < sizeof(licenses);  i++) {  
  if (userL[0] != correctL) {  
      // license is wrong !  
  }  
}

Cheers,
Niklas

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 19/10/2011 at 00:56, xxxxxxxx wrote:

Its Smart, Thanks

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 23/10/2011 at 04:50, xxxxxxxx wrote:

Using COFFEE I can execute program or open file, if success return true.

Is there a way to execute a program and pass command parameter and get the output result?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 24/10/2011 at 05:24, xxxxxxxx wrote:

Originally posted by xxxxxxxx

Is there a way to execute a program and pass command parameter and get the output result?

Unfortunatly not.

cheers,
Matthias