15.02.2015 Views

C# 4 and .NET 4

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Clickonce ❘ 419<br />

ProPerTy<br />

IsApplication<br />

LogVisits<br />

Property<br />

VirtualDirectory<br />

desCriPTion<br />

Boolean value that, if true, instructs IIS to create the application root for the<br />

folder.<br />

Boolean value that, if true, logs visits to the web site in a log file. Maps to the<br />

Log Visits property of IIS.<br />

The named property that can be accessed at installation time.<br />

The virtual directory for the application. This is relative to the web server.<br />

You might notice that most of these properties are properties of IIS <strong>and</strong> can be set in the IIS Administrator<br />

tool. So, the logical assumption is that to set these properties in the installer, the installer will need to run<br />

with administrator privileges. The settings made here can compromise security, so the changes should be<br />

well documented.<br />

Other than these properties, the process of creating the deployment package is very similar to the previous<br />

client example. The main difference between the two projects is the ability to modify IIS from the<br />

installation process. As you can see, you have a great deal of control over the IIS environment.<br />

Client from Web server<br />

Another installation scenario is either running the install program from a web site or actually running<br />

the application from a web site. Both of these are attractive options if you must deploy an application to a<br />

large number of users. By deploying from a web site, you eliminate the need for a distribution medium such<br />

as CD-ROMs, DVDs, or even floppy disks. By running the application from a web site or even a network<br />

share, you eliminate the need to distribute a setup program at all.<br />

Running an installer from a web site is fairly simple. You use the Web Bootstrapper project compile option.<br />

You will be asked to provide the URL of the setup folder. This is the folder in which the setup program is<br />

going to look for the .msi <strong>and</strong> other files necessary for the setup to work. After you set this option <strong>and</strong><br />

compile the deployment package, you can copy it to the web site that you specify in the Setup folder URL<br />

property. At this point, when the user navigates to the folder, she will be able to either run the setup or<br />

download it <strong>and</strong> then run it. In both instances, the user must be able to connect to the same site to finish<br />

the installation.<br />

CliCKonCe<br />

ClickOnce is a deployment technology that allows applications to be self-updating. Applications are<br />

published to a file share, web site, or media such as a CD. When published, ClickOnce apps can be<br />

automatically updated with minimal user input.<br />

ClickOnce also solves the security permission problem. Normally, to install an application the user needs<br />

Administrative rights. With ClickOnce, a user can install <strong>and</strong> run an application with only the absolute<br />

minimum permissions required to run the application.<br />

Clickonce operation<br />

ClickOnce applications have two XML-based manifest files associated with them. One is the application<br />

manifest, <strong>and</strong> the other is the deployment manifest. These two files describe everything that is required to<br />

deploy an application.<br />

The application manifest contains information about the application such as permissions required,<br />

assemblies to include, <strong>and</strong> other dependencies. The deployment manifest is about the deployment of<br />

the app. Items such as the location of the application manifest are contained in the deployment manifest.<br />

The complete schemas for the manifests are in the .<strong>NET</strong> SDK documentation.<br />

www.it-ebooks.info

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

Saved successfully!

Ooh no, something went wrong!