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

Notification

Icon
Error

Building UWS+ASP.NET app installation with Advanced Installer
Ultidev Team
#1 Posted : Wednesday, October 26, 2011 8:44:49 PM(UTC)
Ultidev Team

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

Thanks: 28 times
Was thanked: 53 time(s) in 52 post(s)
Introduction

This article is a walk-through document describing making a web application installation package with Advanced Installer (AI), incorporating redistributable UltiDev Web Server Pro (UWS). We have used version 8.6, which was latest at the time of writing, but the article should be applicable to both older and future released of Advanced Installer.

This article assumes that you have UltiDev Web Server Pro installed. If not, please download it first. Advanced Installer support is added to UWS build 12. If you are using earlier version of UWS, please upgrade to the latest one, or add UWS prerequisite to AI manually. We also use Visual Studio ASP.NET application project as a starting point, but feel free to skip Visual Studio part if it's not applicable.

In any case, you should have:

Attached to this forum entry, is the ZIP archive with the built single-EXE installation package, and Visual Studio solution including ASP.NET sample application and the Advanced Installer project. Please scroll down to find the attachment.

Adding Advanced Installer project to Visual Studio solution
(As we mentioned, Visual Studio part is optional, so if you don't use VS, you can skip straight to editing AI project.)

Start with opening a solution with your ASP.NET application in Visual Studio and add AI project to the solution:


Then you'll need to tweak configuration manager slightly. You probably don't need to build installer in the DEBUG configuration, so we are only showing RELEASE in the next screen shorts:


Once that is done, build the solution and open AI project in the Advanced Installer:


Scroll down to keep reading.
File Attachment(s):
UWS ASP.NET App Redistribution Example.zip (484kb) downloaded 164 time(s).
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Ultidev Team
#2 Posted : Thursday, October 27, 2011 8:48:18 PM(UTC)
Ultidev Team

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

Thanks: 28 times
Was thanked: 53 time(s) in 52 post(s)
At this point you have created a standard .NET installation project in Advanced Installer and ready to fill it in with your project files, configuration settings and custom installation steps.

Since installing UWS and registering your application with it requires administrative privileges, start with changing installation type to "Per machine only".


Creating application shortcut file

Now we'll take a small detour. If you follow web application registration with UWS best practices, you will want to create a shortcut to your installed application after the installation process is over. This shortcut is a file of .url type; that URL will redirect users to your installed application, and the URL file needs to be added to your project.

Start with bringing up AI project's options..


... and then going to Project IDs tab and copying Upgrade Code to the clipboard:


Now go back to Visual Studio or whatever your IDE is and add .url file to the project, and, first, enter
Quote:
[InternetShortcut]
URL=http://localhost:7756/GoToApplication.aspx/

and then paste your Upgrade Code from the prior step, comma-separated from the list of ports where your application will be listening:

Save changes and go back to AI. We'll use the URL file later. For more details on how redirection URL can be crafted, please refer to Finding URL to your application after registration.

Adding .NET Framework 2 with Service Pack as a setup prerequisite

Before we add UltiDev Web Server Pro to the installation, you need to add .NET Framework 2.0 with SP1 or SP2 as a dependency. In this example, we'll add .NET Framework 2.0 SP1. Note that Service Pack 1 for .NET 2 is required for UWS to work properly, even if .NET Framework 4.0 is present on the target system.


Adding UWS as a setup prerequisite

In Prerequisites section, add UltiDev Web Server Pro prerequisite and specify "/passive" as a "Basic UI" command line parameter to spare your end user from having to answer UWS installation questions:

Default settings of the prerequisite will ensure that latest version of UWS is downloaded from UltiDev.com web site during installation. If you don't want your installer to depend on internet connection, you can change "Setup file location" from URL to "File in package" and settings file path to "C:\Program Files\UltiDev\Web Server\Redist\Visual Studio\UltiDev.WebServer.msi"

Make UWS prerequisite dependent on .NET Framework prereq and tell the setup bootstrapper to run your prerequisites with basic UI, i.e. with just showing progress but not asking user for input:



Specifying installation launch conditions and bootstrapper options

Launch conditions need to be set to reflect the fact that UWS does not support Windows before XP SP2, and that in order to run installation as elevated/administrator, to avoid custom actions popping up elevation dialog many times. And since you're most likely to distribute your work over the internet, a single-EXE installation is s must:



Adding files to the installation

Filling your installer with files will begin with adding a program starter utility that we'll use to launch custom actions. We need it because MSI has trouble running programs not from the installation itself, while we'll need to run UWS application registration utility that is not a part of the installation.


Now we'll add your web application files. We'll start with creating a "WebApp" folder under "Application Folder" and insuring it has "WebApp_Dir" indetifier:



Next, let's add content to the WebApp folder by syncing it with your application folder, and excluding files that are unnecessary during run time:


Next, let's add recently-created URL shortcut file to the Programs menu by syncing IA's "Application shortcut folder" with your actual application folder, and then explicitly including only .url files in the sync:




Registering the application with UWS with Custom Actions

Finally, your application needs to be registered with UWS during installation, and unregistered during uninstallation. There are two ways to do it: one is using UWS configuration .NET & COM API, and another, more universal and simple, is to use UWS application registration utility. Here we demonstrate how command line utility option can be used.

We'll start with adding application unregistration step for Uninstall and failed installation Rollback situations because they are simpler than registration and are the same for all vendors and all applications.

Add "New Installed Custom Action" to "Uninstall", as shown below, and select Started.exe:


Name the uninstall step "UnregFromUWS", or whatever other name you like, set Execution Properties to "Sync execution, ignore return code", and paste following into the "Command Line" textbox:
Quote:
"[ProgramFilesFolder]\UltiDev\Web Server\UWS.RegApp.exe" /u /appid=[UpgradeCode]


When your application is unregistered, its configuration is usually saved for later, in case it gets re-registered later (for example during the upgrade installation), in which case some old configuration defaults will be reused in new installation, like system-assigned listen port number.

Repeat the previous step for the Rollback custom action, with the exception of naming it something like "UnregFromUWS_RB":


Finally, we'll add the custom action that registers the application with UWS. "Command Line" value will consist of two parts:

  1. Static, unchanging part:
    Quote:
    "[ProgramFilesFolder]\UltiDev\Web Server\UWS.RegApp.exe" /r /appid=[UpgradeCode] "/path=[WebApp_Dir]"

  2. Application-specific parameters, like listen endpoints, virtual directory, .NET Framework version, default document, etc. We suggest that listen endpoints should be configured this way:
    Quote:
    "/url=http://*:80/,http://*:8080/,http://*:0/"
    It makes application try to listen on both popular standard HTTP ports, like 80 and 8080, as well as tell UWS to register the application on any free port. Even though application registered on an arbitrary port will be listening on different ports when installed on different machines, UWS still gives you an application redirection URL wired through a well-known port 7756. We created redirection shortcut file in the beginning of this walk-through.
    Quote:
    We also recommend that you use non-"/" virtual directory for your application, to allow for sharing popular HTTP ports, like 80.
    However, if your application needs to use scripts in "/aspnet_client", like applications using Crystal Reports, then you will have to use "/" virtual directory.


Registration utility parameters are well-documented and roughly match application settings found in UWS Explorer management console.
In the example shown above ports 80, 8080, and a free UWS-assigned ports will be used, along with virtual directory "AIredist".

At this point you can build and run your application installation.

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.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Ultidev Team
#3 Posted : Friday, October 28, 2011 4:46:41 PM(UTC)
Ultidev Team

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

Thanks: 28 times
Was thanked: 53 time(s) in 52 post(s)
Installing web application shipped with UWS
Ultidev Team attached the following image(s):
Ultidev Team attached the following image(s): 301 - UWS Redist - Installing - Downloading UWS.png
Ultidev Team attached the following image(s): 302 - UWS Redist - Installing - Installing UWS.png
Ultidev Team attached the following image(s): 303 - UWS Redist - Installing - starting app isntallation.png
Ultidev Team attached the following image(s): 304 - UWS Redist - Installing - installing app.png
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Ultidev Team
#4 Posted : Friday, October 28, 2011 4:49:46 PM(UTC)
Ultidev Team

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

Thanks: 28 times
Was thanked: 53 time(s) in 52 post(s)
Here's how UWS-based web application looks installed
Ultidev Team attached the following image(s):
Ultidev Team attached the following image(s): 33 - UWS Redist - Installed - in AddRemove Programs.png
Ultidev Team attached the following image(s): 34 - UWS Redist - Installed - running in browser.png
Ultidev Team attached the following image(s): 31 - UWS Redist - Installed - App in UWS Explorer.png
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Guest
#5 Posted : Tuesday, March 8, 2016 2:41:02 AM(UTC)
Groups:

Message was deleted by a Moderator.
Rss Feed  Atom Feed
Users browsing this topic
Guest
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.