Welcome Guest! To enable all features please Login or Register.



Building UWS+ASP.NET app installation with InstallShield
Ultidev Team
#1 Posted : Friday, December 23, 2011 5:27:04 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)

This article is a walk-through document describing making a web application installation package with InstallShield Light Edition (LE), incorporating redistributable UltiDev Web Server Pro (UWS). The version we have used is InstallShield LE 2011, which was latest at the time of writing, but the article should be applicable to newer versions of ISLE and non-express versions of InstallShield.

This article assumes that you have UltiDev Web Server Pro installed. If not, please download it first. InstallShield support was added to UWS build 9. If you are using earlier version of UWS, please upgrade to the latest one. For your convenience at the end of the post you can find a ZIP file with the Visual Studio 2010 solution that includes simple ASP.NET application and ISLE installation project.

In any case, you should:

Adding InstallShield LE project to Visual Studio solution

Let's start with opening a solution with your ASP.NET application in Visual Studio and adding an ISLE project to the solution:

If InstallShield LE is not yet installed, it will guide guide you through the process of getting a copy of ISLE downloaded and installed. InstallShield LE is free of charge.

Once project is added to the solution, right-click the solution node and select "Configuration Manager" item to ensure that newly-added project will be built in the Release configuration.

Specifying General ISLE Setup Project Properties

Since this article focuses on getting UWS and your application installed, we are not going to go into details on how to set up all possible properties of an ISLE project. Instead, we'll only focus on project settings critical for the task at hand.

Let's start with creating a "WebApp" sub-folder in the installation folder:
Using a sub-folder for the web application itself is a good practice, as in the real-world installation project its parent folder is likely to contain additional non-web application files, like icons, license agreement, etc.

Now copy & paste appropriate ASP.NET project outputs into the WebApp project:

Here we'll add UltiDev Web Server Pro as a component to your installation. Also, please add .NET Framework 2.0 SP1 or SP2, or .NET 3.x as a prerequisite too. UWS requires .NET 2.0 SP1 to function, event if target system has .NET Framework 4.0.

That's truly all you have to do. Easy, right? Just one thing to note, your installation MSI package does not include UWS. Instead, setup bootstrapper file, the "setup.exe", will have the link to the UWS component.

Since installing a web server and registering a web application is a security-sensitive matter, UWS requires end user who does the installation to have Administrative/Elevated privileges. To minimize number of elevation prompts, let's add elevation demand to the Setup.exe itself:

Registering web application with UltiDev Web Server Pro

Installation process will make sure that UWS is installed and up & running by the time your applications starts getting installed. But at the end of the installation process your application needs to register itself with UWS. Although there are multiple ways to register a site or application with UWS (like .NET API and scriptable COM API), the easiest way to register an app with UWS is to use registration command line utility.

Application registration command line utility has quite a few parameters, but to simply get job done the example below can be used virtually unchanged - just replace application virtual directory, .NET version (if necessary), and application name & description with your own.

Let's add a custom step to the end of the installation process:

.. and apply settings that will register the application:

For source location select "File Exists on Target Computer".
For File Location copy & paste: [ProgramFilesFolder]UltiDev\Web Server\Redist
For File Name and Command Line copy & paste:
Starter.exe /s "[ProgramFilesFolder]UltiDev\Web Server\UWS.RegApp.exe" /r AppID:[UpgradeCode] /url=http://*:80,http://*:0/ "/path:[INSTALLDIR]WebApp"
... and enter a variation of:
/Clr:2 /vdir:SomeVDir /ddoc:SomeDefaultDoc.aspx "/appname:Some app name" "/desc:Some app description".
More options are here.
"AppID:[UpgradeCode]" assumes that application ID matches MSI upgrade code. If your .URL file uses GUID that does not match UpgradeCode, use that GUID instead of [UpgradeCode].

And when your application gets uninstalled, it needs to get unregistered. Once again we create an EXE custom installation action and wire it to unregister the application. If your AppID matches [UpgradeCode], then you can following custom step settings literally:

Starting with UWS build 15, UWS.AppReg.exe utility started creating desktop shortcuts for registered applications. These shortcuts are app-settings-agnostic, i.e. they will work even if application gets moved to another port, gets another vdir or default doc, etc. (Shortcuts can also be created using UWS.Configuration API's application registration methods.) UWS can create up to three shortcuts icons per application, to accommodate needs for different shortcut file locations, hostnames, icon images and start pages. See "/SHORTCUTxxx" parameter info for more details.

Another frequently-requested installation feature is UWS.AppReg.exe ability to launch newly-registered application in a browser. See "/AUTOSTART:timeout|startpage" parameter info for more details.

Building the project and testing installation

At this point your project is ready and can be built. After InstallShield builds it, it will place UltiDev Web Server Pro installer in a sub-folder next to the application setup.exe file. For a full test, and even for production, you probably want UWS component to be downloaded from the Internet, unless you target systems that have no Internet access. To test this approach, please locate your single-image setup.exe, which contains your entire application less UWS and other prerequisites, and delete the IsSetupPrerequisites folder:

Now simply run the setup.exe and watch it download and install UWS if UWS is not present:

At this point of the installation, UWS is already on the system, and your application is ready to get installed and registered with UWS:

Once the application is installed, you may test it by finding and clicking application's desktop shortcut or launching UWS Explorer and browsing to your application from there:

If everything went well, the application will be siting very pretty in the browser:

Below is the Visual Studio 2010 project with working installer sample. Enjoy!
File Attachment(s):
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
#2 Posted : Tuesday, March 8, 2016 3:40:30 AM(UTC)

Message was deleted by a Moderator.
Rss Feed  Atom Feed
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.