Slim57
Posts: 9
Joined: Fri Sep 12, 2014 10:23 pm

Proper approach to build advanced installer

The requirement is to build a single click installer for a system that consists of a .asp web application, windows service, an app to configure the service and an instance of sql server express. The asp web app is to be hosted in IIS, and requires .net framework 4.5.

I'm new to installers, but I think that I should be able to install all above components using a single installer. The basic requirement is for no user interaction, so the sql server and windows service installations need to be non interactive but if a more sophisticated user would like to take more control, interactive setup is optional.

I'm currently working on getting a installer working to install the service alone, to familiarize with the process.

So if anyone can offer a proper approach for implementing above, I thank you.
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Proper approach to build advanced installer

Hello,
The requirement is to build a single click installer for a system that consists of a .asp web application, windows service, an app to configure the service
You can add your service and configure it in the Services page. You can take a look on the Creating a Java Service Installation tutorial with related information for hints and guidance.
sql server express
You can add the desired version of the SQL Server from our predefined list of prerequisites. You can also take a look on the Add Prerequisite article which contains useful information.
The asp web app is to be hosted in IIS, and requires .net framework 4.5.
You can add your asp web app in the IIS page. Since your application require the .Net Framework 4.5, you can add it as a prerequisite too in the Prerequisites page.
I'm new to installers, but I think that I should be able to install all above components using a single installer.
Yes, following the above steps will produce a single installation package.
The basic requirement is for no user interaction, so the sql server and windows service installations need to be non interactive but if a more sophisticated user would like to take more control, interactive setup is optional.
You can try to following approach for this.
In the Install Parameters page define a property, something like that:
  • Name: INSTALLER_LEVEL
  • Value: /qb
Then, you can go in the Configuration tab from the Media page and add a reference to the related property in the MSI Command Line: field which is of PseudoFormatted Type (e.g. [|INSTALLER_LEVEL] ). So, when you will run the installer if will be launched with basic user interface (simple progress bar and error handling).

For advanced users, you reset the value of the INSTALLER_LEVEL property through the command line. In order to achieve that, you can use a command line statement like this:

Code: Select all

"My App.exe" INSTALLER_LEVEL=""
Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Slim57
Posts: 9
Joined: Fri Sep 12, 2014 10:23 pm

Re: Proper approach to build advanced installer

I have made some progress, added a prerequisite to install sql server 2014 without interaction, by provide command line parameters in the prerequisite design page, it works just fine. First time installer runs, sqlserver express 2014 is installed, subsequently, pre req is fulfilled, and is not attempted again. All good.


Sooo, after sql server is installed, I need to run a batch, which calls sqlcmd.exe, batch creates the initial database, and populates fixed data. OK, so I see the url http://www.advancedinstaller.com/user-g ... -file.html, and I follow the steps there. I add the batch file and the sql script include file to appdir folder, set up a launch file custom action run the installer, and sure enough, the batch and the script file are copied to APPDIR folder.

I also am prompted for admin permission by windows command processor, indicating that the batch is being attempted.

Bad news, is the installer fails: " a program run as part of setup did not finish as expected ..." and the database operations did not take place.

I can run the batch in an administrator Windows\System32\cmd window, at command line, it completes with no problem, creates initial data.

It seems near impossible to tell what is wrong, it seems the actual command line and folder attempted by the installer are hidden from installer developer. I create log, but it seems to shed very dim light.

Any thoughts as to how to debug?
Attachments
LIGHTSPACE Data 2014.aip
(23.21 KiB) Downloaded 341 times
Slim57
Posts: 9
Joined: Fri Sep 12, 2014 10:23 pm

Re: Proper approach to build advanced installer

Oh gosh, I got the batch to run by clearing the "Command Line:" field on the Launch File properties. The web page (http://www.advancedinstaller.com/user-g ... -file.html) instructions for this field seem completely misleading, they state (and I quote): "The Command Line field should contain the full path of the file you want to launch ", when in fact the command line field seems to be command line arguments. My batch needs no arguments, so I cleared it. Also checked Run Under LocalSystem account, this is necessary, but the error message provides no clue for this either.

This only became apparent after showing details on the User Account Control dialog that ran in response to Launch File invocation of cmd.exe.

It seems that experience as a voodoo practitioner or a clairvoyant is helpful for setting up installers. My confidence in the web documentation is flagging...
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Proper approach to build advanced installer

Hello,
Bad news, is the installer fails: " a program run as part of setup did not finish as expected ..." and the database operations did not take place.
The message code 1772 with the message There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. is a generic Windows Installer error and mostly can be encountered when a custom action fails to execute.
Oh gosh, I got the batch to run by clearing the "Command Line:" field on the Launch File properties. The web page How do I launch a CMD or BAT file?) instructions for this field seem completely misleading, they state (and I quote): "The Command Line field should contain the full path of the file you want to launch ", when in fact the command line field seems to be command line arguments. My batch needs no arguments, so I cleared it. Also checked Run Under LocalSystem account, this is necessary, but the error message provides no clue for this either.
Indeed, when the UI for the Launch File custom action has been changed, the User-Guide hadn't been updated. We will update our User-Guide ASAP.
Thank you for bringing it to our attention.

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”