Online Packaging APIs

Top  Previous  Next

The PackagerRequestSubmitUrl API

 

Syntax

string PackagerRequestSubmitUrl(string userName, string password, string url, PackagerEnvironment environment)

Submits an application packaging request to the Cameyo Online cloud packager.

 

Parameters

UserName: user account name (email address).
Password: user account password.
URL: direct URL of the installer to package.
Environment: OS environment to package the software on: 32-bit or 64-bit.

 

Return value

String containing the request ID. This string can then be passed to the PackagerStatus function.

 

Sample code:

Cameyo Online is a WCF service that allows you to integrate some of Cameyo's cloud capabilities into your .NET apps (both Windows / Web).

To add Cameyo Online to your Visual Studio project, see these simple steps:

 

1. Add a Service reference to your .NET project:

1 - AddServiceRef

 

2. Enter CameyoOnline's WSDL URL:

2 - CameyoOnlineRef

 

The following code shows how to create a virtual package from A to Z, simply by providing an installer. The project can be downloaded from here.

 

var svcClient = new CameyoOnlineSvc.CameyoOnlineSvcClient();

var packagerEnv = new CameyoOnlineSvc.PackagerEnvironment();

packagerEnv.Architecture = CameyoOnlineSvc.ArchitectureType.OS32;

String reqId = "";

try

{

  // DO NOT FORGET to change this line: your Cameyo login (email, password) and direct installer URL to package

   reqId = svcClient.PackagerRequestSubmitUrl(

      "your_cameyo_account@email.com", "your_password",   // Replace with your Cameyo login info

      "http://www.skype.com/go/getskype-msi", // The installer you wish to package (has to support unattended installation)

       packagerEnv);

}

catch (Exception ex)

{

  Console.WriteLine("Exception: " + ex.Message);

  return;

}

 

bool working = true;

while (working)

{

   System.Threading.Thread.Sleep(1000);  

   CameyoOnlineSvc.RequestStatus reqStatus = svcClient.PackagerStatus(reqId);

  String str = "";

  switch (reqStatus)

   {

      case CameyoOnlineSvc.RequestStatus.Queued: str = "Queued"; break;

      case CameyoOnlineSvc.RequestStatus.NeedArguments: str = "Installer arguments required (does this installer support unattended mode?)"; working = false; break;

      case CameyoOnlineSvc.RequestStatus.Packaging: str = "Packaging"; break;

      case CameyoOnlineSvc.RequestStatus.Failed: str = "Failed"; working = false; break;

      case CameyoOnlineSvc.RequestStatus.Success: str = "Success.\nPackage ready at: " + svcClient.PackagerResult(reqId).DownloadUrl; working = false; break;

   }

  Console.WriteLine("Status = " + str);

}