1300 223 482
CSA
Cheaper Citrix Licensing



Licensing Guarantee

XALocLaunch - Use your GPS location to Launch Windows Applications and Scripts on your mobile device.

XALocLaunch is a mobile device enabled utility that can be used to launch windows applications or scripts based on the GPS co-ordinates of the end-user mobile device. This single utility, delivered as a published application or included in a logon script, provides the ability to use one application to launch any application running centrally through a Citrix XenApp 6.5 or higher server, based on the GPS co-ordinates of a local device with location services enabled.

The case may arise where a salesperson who travels globally, may need to access sales records for a particular state or country. Each state or country has their own database and application stored within the same Citrix Server, and normally a separate published application is required to deliver each location specific application to the end user, resulting in multiple icons on the Citrix Receiver. This can become confusing and frustrating.

With this utility, as the salesperson moves through each state or country, they have one application delivered through the Citrix receiver on their mobile device. This application, XALocLaunch, can determine the location that the salesperson is currently in, and launch the appropriate application from the Citrix XenApp/ XenDesktop Server. This utility can also be used to launch scripts to map drives for example, or even be included within a script to select printers or similar.

XALocLaunch works together with a config.csv file in the same directory where XALocLaunch is installed and executed. The config.csv file contains the information of the location from where a specific application can launch from, and of course details regarding the application executable are also stored in this file. The location comparison between the GPS co-ordinates of the user mobile device and that stored in the config.csv file are measured by standard latitude and longitude in decimal format. A tolerance or variance based on the location can also be included to ensure that applications can be launched based on a region around a centrally defined point. This variance is defined in Minutes, therefore allowing an application to be launched within 10 minutes, for example around a central set of GPS co-ordinates.

An example of the config.csv file is included in the FREE downloadable file from http://www.ctrl-alt-del.com.au Config.csv format example:

;The format of this file should be one record per line, with each field seperated
; by a comma, with a Carriage Return to finalise the line. Semi-colons at the
; beginning of the line for comments.
;
;The first record found that matches the GPS co-ordinates of the device, will
;launch the associated application. No other records will be processed
; after that.
;
;
;for example ;field1, field2, field3, field 4
;latitude, longitude, Tolerance (in minutes), path to application
;
;Real data to be used
;
40.68,-74.00,60,C:\Windows\System32\notepad.exe
-27.516759,153.044689,30,d:\APPS\Office14\winword.exe H:\Memo.docx
50.11,23.30,90,C:\Windows\System32\regedt32.exe
-27.516759,153.044689,30,d:\apps\WinRAR\winrar.exe
27.00,133.00,90,C:\Program Files\Windows NT\Accessories\wordpad.exe
-27.6167,153.1333,10,C:\windows\system32\mspaint.exe

Usage: XALocLaunch [/V] [/?]

/V Show verbose output to command line - for debugging purposes

/? This help information.

XALocLaunch requires that the config.csv file is install in the same directory as XALocLaunch otherwise the program will error out.

Requirements:
VC++ 2010 sp1 runtime is required for this program to operate
YYou must install the Citrix Mobility Pack as detailed at http://support.citrix.com/proddocs/topicxenapp65-mobility-packps-mobility-pack-install.html
You must enable the following citrix policy in the Citrix user policy settings:
- Allow applications to use the physical location of the client device setting,
more information can be found at:
http://support.citrix.com/proddocs/topic/xenapp65-admin/ps-ref-policies-client-sensors.html
The end user will be required to ALLOW the use of the location sensor on the
device as the application launches. Failure to allow will close the program. The
end user device mush have location services enabled.


This utility is FREEWARE and was written by Warren Simondson of Ctrl-Alt-Del IT Consultancy, Australia.

www.ctrl-alt-del.com.au

This program and the code may not be reproduced for profit.

SDK's used in this program:

Citrix MOBILITY SDK - http://community.citrix.com/display/xa/Download+SDKS
Microsoft Windows 2008 SDK - http://msdn.microsoft.com/downloads

IN NO EVENT WILL CTRL-ALT-DEL IT CONSULTANCY BE LIABLE TO YOU FOR ANY GENERAL, SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR OTHER DAMAGES ARISING OUT OF THIS PRODUCT.

Comments

Your comments or questions are more than welcome for this topic. Comments can be posted on the Citrix Community Mobility SDK forum or you can use our Ctrl-Alt-Del IT Consultancy web form to ask questions directly.
We hope that this page is of great assistance to you.

The Application

System Requirements

Download
Download the Executable for XALocLaunch here (VS10 C++ compiled):
XALocLaunch.zip

Instructions for Use

  1. Download XALocLaunch.zip from Ctrl-Alt-Del IT Consultancy
  2. Unzip the file into the desired directory on your Citrix XenApp 6.5 Server. The program is a single executable and is not an install package so it can be run immediately after copying to your system
  3. Ensure Microsoft Visual C++ 2010 Redistributable Package is installed.
  4. Ensure Citrix Mobility Pack is installed and policies are set as described.
  5. Publish XALocLaunch.exe via the Citrix Access Console, selecting the approriate users to delivery the application to.
  6. Adapt the config.csv file to suit your requirements as described.
  7. Once the application is published, and the config.csv file is as per requirements, connect your mobile device to the Citrix Receiver configure to point to your Web Interface site or Service site. Launch the application as show below.
  8. Please note: For the location services to work correctly you must enable enable the following citrix policy in the Citrix user policy settings: - Allow applications to use the physical location of the client device setting.
  9. Additional Note: Turn off that annnoying Special keys option whilst you're in the Citrix Receiver Options.

XALocLaunch Example

Designed to launch applications from Citrix XenApp 6.5 based on the location of  your mobile device (with GPS enabled), this little program will provide a simple, mobile method for performing such a task. Using the Citrix Receiver on your mobile device, this application can provide a company with instant access to location specific applications. Launch the application from the Citrix Receiver for your mobile device and the rest is easy.

XALocLaunch Example

XALocLaunch has been designed to run on virtually all Mobile devices utilising the Citrix Receiver. GPS capabilities must be available on the device. As an employee, just have mobile device at the ready, launch the application and wait for the main screen to appear.

XALocLaunch Example

When the application is available, you will be asked to allow access to the location services of your device. Press ALLOW and XALocLaunch will determine your location and check to see if a match exists between your location and that listed in config.csv.

If a match is found, the corresponding Application that aligns to the first set of co-ordinates matched will launch.

XALocLaunch Example

That's it! A Windows based application is launched from a Citrix Server based on the GPS co-ordinates of the end user device.

The Code

System Requirements

Download
Download the source code for XALocLaunch here (VS10 C++ compiled):
XALocLaunch_src.zip

Tips of Programming with the Mobility SDK
The following are some tips that I found may help everyone as they write their first app using the Citrix Mobility SDK. These tips are based on coding your application in Win32 or MFC using Micrsoft Visual C++.

Key Areas
The key area to this application is retrieving the GPS co-ordinates from the mobile device using the Windows Location API. The following subroutine is the primary code that allows the application to retrieve this information through the Citrix Receiver.

The code listed below outlines the sub routine.

/********************************************************************
*
* GETLOCINFO
*
* Get user information from system
* ENTRY:
* none
*
* EXIT:
* nothing
*
********************************************************************/
void GETLOCINFO () {

// Location API Code - with thanks to http://www.mapping-tools.com

// our location specific private data members
LOCATION_REPORT_STATUS status;
double lfCurLat, lfCurLng; //variable for Longitudw and Latitude
TCHAR tmp6[MAX_PATH]; //temporary string

// Define our report objects
CComPtr spLoc; // This is the main Location interface

// These store the reports we request from spLoc
CComPtr spLocationReport; // This is our location report object
CComPtr spLatLongReport; // This is our LatLong report object

//init vars
memset( &tmp6, 0, sizeof(tmp6) );
_tcscpy(tmp6, _T(""));

// Create the Location object
status = REPORT_NOT_SUPPORTED;
if (SUCCEEDED(spLoc.CoCreateInstance(CLSID_Location)))
{
// Array of report types of interest.
// Civic addresses/etc also supported
IID REPORT_TYPES[] = { IID_ILatLongReport };

// Request permissions for this user account to receive location
// data for all the types defined in REPORT_TYPES
// The final parameter (TRUE) indicates a synchronous request
// use FALSE to request asynchronous calls
if (FAILED(spLoc->RequestPermissions(NULL, REPORT_TYPES, ARRAYSIZE(REPORT_TYPES), TRUE)))
{
AfxMessageBox("Warning: Unable to request permissions.\n");
} else {

// Get the report status
if (SUCCEEDED(spLoc->GetReportStatus(IID_ILatLongReport, &status)))
{
//if you really want to know the status of the location services report - add this
/*
switch (status) // If there is an error, print the error
{
case REPORT_RUNNING:
// If the status for the current report is running
AfxMessageBox("Report received okay");
break;
case REPORT_NOT_SUPPORTED:
AfxMessageBox("No devices detected.");
break;
case REPORT_ERROR:
AfxMessageBox("Report error.");
break;
case REPORT_ACCESS_DENIED:
AfxMessageBox("Access denied to reports.");
break;
case REPORT_INITIALIZING:
AfxMessageBox("Report is initializing.");
break;
} //switch
*/

// Get the current location report (ILocationReport) and
// then get a ILatLongReport from it
// Check they are are reported okay and not null
if ( (SUCCEEDED( spLoc->GetReport(IID_ILatLongReport, &spLocationReport)) )
&& (SUCCEEDED( spLocationReport->QueryInterface(&spLatLongReport)) ))
{
lfCurLat = 0;
lfCurLng = 0;

// Fetch the latitude & longitude
spLatLongReport->GetLatitude(&lfCurLat);
spLatLongReport->GetLongitude(&lfCurLng);

// Format them into a string for display
_stprintf(_T(tmp6), _T("Lat: %.6f, Lng:%.6f"), lfCurLat, lfCurLng);
_tcscpy(nfoStr3, tmp6);

} //if succeeded

} //if Succeeded
} // if failed
// We have completed our call
} //if succeed
return;
}

Comments

Your comments or questions are more than welcome for this topic. Comments can be posted on the Citrix Community Mobility SDK forum or you can use our Ctrl-Alt-Del IT Consultancy web form to ask questions directly.
We hope that this page is of great assistance to you.