21.02.2013 Views

Deploying Desktop and Engine Applications in .NET - Esri

Deploying Desktop and Engine Applications in .NET - Esri

Deploying Desktop and Engine Applications in .NET - Esri

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Deploy<strong>in</strong>g</strong> y g <strong>Desktop</strong> <strong>and</strong> <strong>Eng<strong>in</strong>e</strong> g <strong>Applications</strong><br />

<strong>in</strong> .<strong>NET</strong><br />

Bhagavath Kumar<br />

Mita Patel


Agenda<br />

• Today we will cover<br />

– General Development Issues<br />

– General G Deployment p y Issues<br />

– Demonstration<br />

• (Create a deployment package <strong>in</strong> Visual Studio)


Development <strong>and</strong> Deployment Deployment Cycle<br />

Cycle<br />

Development mach<strong>in</strong>e DDeployment l t mach<strong>in</strong>e hi<br />

Visual Studio<br />

setup setup.exe exe / setup.msi setup msi<br />

ArcGIS <strong>Eng<strong>in</strong>e</strong> / ArcGIS <strong>Desktop</strong><br />

Your custom application<br />

Your custom application


G General l<br />

Development<br />

p<br />

Issues


Development Prerequisites<br />

ArcGIS <strong>Eng<strong>in</strong>e</strong> <strong>Applications</strong><br />

• ArcGIS <strong>Eng<strong>in</strong>e</strong> g Runtime<br />

• ArcObjects SDK<br />

ArcGIS <strong>Desktop</strong> <strong>Applications</strong><br />

Focus<br />

• ArcGIS <strong>Desktop</strong><br />

• ArcObjects SDK<br />

• ArcGIS <strong>Desktop</strong> ( (ArcInfo ArcInfo)<br />

• ArcGIS <strong>Eng<strong>in</strong>e</strong> Runtime<br />

• ArcObjects .<strong>NET</strong> SDK


ArcObjects SDK …<br />

ESRI’s Visual Studio Integrated Development Environment Tools:<br />

• ArcGIS W<strong>in</strong>dows Forms Active X Controls<br />

• Project <strong>and</strong> Item Templates<br />

• ArcGIS Snippets (Snippet F<strong>in</strong>der <strong>and</strong> Snippet Editor)<br />

• Add ArcGIS Reference Dialog<br />

• License Initializer Dialog<br />

Developer resources<br />

• HTML Help documentation<br />

• Samples<br />

• Object Model Diagrams<br />

<strong>Eng<strong>in</strong>e</strong> Developers<br />

• Ri Rights ht to t redistribute di t ib t the th <strong>Eng<strong>in</strong>e</strong> E i Runtime R ti setup<br />

t


ArcGIS W<strong>in</strong>dows Forms Active X Controls


Development Scenarios<br />

• An executable (.exe)<br />

• A dynamic l<strong>in</strong>k library (. (.dll dll)<br />

• Hybrid: 1+ .exe(s) <strong>and</strong> 1+ .dll dll(s) (s)<br />


General<br />

Deployment<br />

Issues


What is is Deployment<br />

Deployment<br />

• Process which makes your application available for use.<br />

• Th<strong>in</strong>gs to consider<br />

– Application Application resources<br />

resources<br />

– Application pre pre-requisites requisites<br />

– Application system requirements


What What are are the the different different deployment options?<br />

• XCOPY <strong>and</strong> manual registration<br />

• Batch files (.bat)<br />

• Setup.msi Setup Setup.msi msi <strong>and</strong>/or Setup.exe Setup exe<br />

– Microsoft W<strong>in</strong>dows Installer SDK<br />

– InstallShield<br />

– WiX Toolset<br />

– Wise for W<strong>in</strong>dows Installer<br />

– Microsoft Microsoft Visual Visual Studio<br />

Studio


Setup.exe Vs Setup.msi<br />

• .exe - executables<br />

• msi - Microsoft W<strong>in</strong>dows Installer technology uses a package file<br />

(.msi) <strong>and</strong> a client-side <strong>in</strong>staller service (Msiexec.exe). This<br />

service i runs <strong>and</strong> d enables bl your operat<strong>in</strong>g ti system t to t manage the th<br />

<strong>in</strong>stallation. It uses the <strong>in</strong>formation conta<strong>in</strong>ed with<strong>in</strong> the<br />

package file (.msi) to <strong>in</strong>stall the software.<br />

• .exe(s) can call multiple .msi’s (frequently called a bootstrapper)<br />

• An .msi cannot call another .msi (it breaks the ability to use<br />

Add/Remove Programs) g )


Basic Deployment Scenarios<br />

• End user has ArcGIS <strong>Desktop</strong><br />

– Most likely .dll dll(s) (s)<br />

– .exe(s) are possible but not common<br />

• End user has ArcGIS <strong>Eng<strong>in</strong>e</strong> Runtime<br />

– Most likely an .exe<br />

– Possibly additional .dll dll(s) (s) to enhance the .exe<br />

• End End user has both<br />

– Will have both .dll . dll(s) (s) <strong>and</strong> exe(s)


<strong>Deploy<strong>in</strong>g</strong> <strong>Deploy<strong>in</strong>g</strong> an an application<br />

application<br />

Manual Deployment<br />

• Copy the . .dll dll onto the deployment mach<strong>in</strong>e<br />

• Use ESRIRegAsm.exe to register the . .dll dll<br />

[CommonFilesFolder<br />

CommonFilesFolder]\ArcGIS ArcGIS\b<strong>in</strong> b<strong>in</strong>\ESRIRegAsm.exe ESRIRegAsm.exe “YourDLL.dll” /p desktop /v 10.0<br />

ms ms-help://ESRI.EDNv10.0/<br />

help://ESRI.EDNv10.0/ArcObjects_<strong>NET</strong><br />

ArcObjects_<strong>NET</strong>/ed1e3c99 /ed1e3c99-4956 4956-4113 4113-b877 b877-df327ac94db0.htm<br />

df327ac94db0.htm


<strong>Deploy<strong>in</strong>g</strong> <strong>Deploy<strong>in</strong>g</strong> an an application<br />

application<br />

Setup Deployment<br />

• Add an <strong>in</strong>staller class to the VS class library project that uses<br />

System.Runtime.InteropServices.RegistrationServices<br />

• Create a Setup Project <strong>in</strong> VS to consume the . .dll dll <strong>and</strong> <strong>in</strong>staller<br />

class to create a setup.exe<br />

ms ms-help://ESRI.EDNv10.0/<br />

help://ESRI.EDNv10.0/ArcObjects_<strong>NET</strong><br />

ArcObjects_<strong>NET</strong>/45c9bbdb /45c9bbdb-6a91 6a91-4edf 4edf-8d4e 8d4e-195486281a2f.htm<br />

195486281a2f.htm


Additionally for for ArcGIS <strong>Eng<strong>in</strong>e</strong> Application Application Deployment<br />

Deployment<br />

• <strong>Eng<strong>in</strong>e</strong> Runtime <strong>in</strong>stalled on the target m/c<br />

– As discussed <strong>in</strong> <strong>in</strong> previous previous slides. slides<br />

• <strong>Eng<strong>in</strong>e</strong> g Runtime not <strong>in</strong>stalled on the target g m/c<br />

– Your application setup <strong>in</strong>stalls the ArcGIS <strong>Eng<strong>in</strong>e</strong> Runtime<br />

<strong>and</strong> d your custom t application. li ti<br />

– User authorizes the ArcGIS <strong>Eng<strong>in</strong>e</strong> Runtime manually.<br />

manually.


<strong>Eng<strong>in</strong>e</strong> Runtime <strong>in</strong>stall options<br />

<strong>Eng<strong>in</strong>e</strong> Runtime can be <strong>in</strong>stalled silently us<strong>in</strong>g msiexec comm<strong>and</strong>s<br />

• Basic UI Install<br />

• msiexec.exe /i \Setup.msi location> Setup.msi / /qb qb<br />

• No UI Install<br />

• msiexec.exe /i \Setup.msi location> location>\Setup.msi Setup.msi / /qn / /qn qn<br />

• Installdir Parameter<br />

• msiexec.exe /i \Setup.msi location> Setup.msi / /qn qn Installdir=c:<br />

Installdir=c:\test<br />

test


Includ<strong>in</strong>g Service Packs<br />

• In case an applications requires ArcGIS <strong>Eng<strong>in</strong>e</strong> Runtime Service<br />

Pack<br />

– Include Include Service pack pack file file ( (msp ( (msp msp) )onCD ) on CD<br />

– Launch with<strong>in</strong> a batch file<br />

REM Set variables<br />

SET MSI_PATH=\Arc<strong>Eng<strong>in</strong>e</strong>\Setup.msi<br />

SET MSP_PATH=\ArcGIS<strong>Eng<strong>in</strong>e</strong>931sp1.msp<br />

REM Launch MSI Silently -NO UI<br />

y<br />

msiexec.exe /i "%MSI_PATH%" /qn<br />

msiexec.exe /p "%MSP_PATH%” /qn


Test<strong>in</strong>g Tips<br />

• Supported platforms<br />

• Compare with ArcGIS supported platforms<br />

• Various configurations<br />

– Bare bones Operat<strong>in</strong>g System<br />

– Operat<strong>in</strong>g System with common softwares like Office <strong>and</strong> Visual Studio<br />

• Test Install<br />

– Launch conditions (Dependencies)<br />

– Compare the Installed files aga<strong>in</strong>st aga<strong>in</strong>st source source image<br />

image<br />

– Test shortcuts<br />

• T Test t U Un<strong>in</strong>stall i t ll<br />

– Test dll un-registration<br />

un registration clean up


Resources<br />

• Platform SDK Documentation<br />

– http://msdn.microsoft.com/en<br />

http://msdn.microsoft.com/en-us/library/aa370834(VS.85).aspx<br />

us/library/aa370834(VS.85).aspx<br />

• ESRI Resource Center website<br />

• http://resources.esri.com<br />

• Software Deployment websites<br />

– http://www.<strong>in</strong>stallsite.org/<br />

– http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.platfor<br />

msdk.msi&lang=en&cr=US<br />

msdk msdk.msi&lang=en&cr=US<br />

msi&lang=en&cr=US


Demonstration<br />

Create a deployment package <strong>in</strong> Visual Studio


Author<strong>in</strong>g a Setup Program<br />

• Create the setup template<br />

• Add the solution files to the template.<br />

• Launch Conditions<br />

• Prerequisites


The Setup Template<br />

• Create the Setup IMAGE<br />

• Create the Setup Template<br />

– Product Information<br />

Information<br />

• (Name, Version, ProductCode, Default Install location etc..)<br />

– Registry Keys<br />

– Features eatu es (optional) (opt o a )


Add Solution files<br />

• Add files<br />

• Register Dll’s<br />

• Add shortcuts


Launch Conditions<br />

• Components required for the setup to run – such as .<strong>NET</strong><br />

Framework Framework, <strong>Eng<strong>in</strong>e</strong> <strong>Eng<strong>in</strong>e</strong> Runtime Runtime, etc. etc<br />

• Registry key’s to check if Microsoft .<strong>NET</strong> Framework V3.5 SP1 is<br />

<strong>in</strong>stalled.<br />

[HKLM [HKLM\Software<br />

[ Software\Microsoft Microsoft\<strong>NET</strong> <strong>NET</strong> Framework Setup Setup\NDP p NDP\v3.5 v3.5<br />

“SP”<br />

• Registry key to check if <strong>Eng<strong>in</strong>e</strong> Runtime is <strong>in</strong>stalled.<br />

[HKLM [HKLM\Software Software\ESRI ESRI\<strong>Eng<strong>in</strong>e</strong>10.0]<br />

<strong>Eng<strong>in</strong>e</strong>10.0]<br />

“Installdir Installdir”<br />

“RealVersion<br />

RealVersion”<br />

RealVersion<br />

“. “.<strong>NET</strong>_Support<br />

<strong>NET</strong>_Support”


Prerequisites<br />

Check for Pre Pre-Requisites<br />

Requisites<br />

– Installed Product, Features <strong>and</strong> Service Packs<br />

– Registry keys<br />

�� <strong>Eng<strong>in</strong>e</strong> g Registry g y keys<br />

y<br />

[HKLM [HKLM\Software Software\ESRI ESRI\<strong>Eng<strong>in</strong>e</strong>10.0]<br />

<strong>Eng<strong>in</strong>e</strong>10.0]<br />

“RealVersion<br />

RealVersion”<br />

“SP”<br />

− Your setup.exe would <strong>in</strong>stall <strong>Eng<strong>in</strong>e</strong> Runtime if not found.<br />

(your Setup.msi Setup msi would not not run run without without it.)<br />

it )


Demonstration

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!