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

Notification

Icon
Error

Cassini 2.0 with InstallShield - how to pass CustomActionData
Armin Mueller
#1 Posted : Wednesday, January 3, 2007 4:44:33 AM(UTC)
Groups: Member
Joined: 1/3/2007(UTC)
Posts: 2

Hi!

I have to create a setup with InstallShield 12 (Basic-MSI-Project) that consists of Cassini 2.0, a web application and a service used by the web application. Everything is fine except that I don't get it how to register my web app during setup, with the help of UltiDevCassiniServerConfiguration.dll. I understand how it's done in a VS2005 setup project with your tuorial but no real help from InstallShield how to do it, like so often. Can anybody give me a hint how to call the dll and pass the required CustomActionData, please.

Armin
Ultidev Team
#2 Posted : Wednesday, January 3, 2007 6:10:55 AM(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)
Hi, Armin.

We don't have much experience with InstallShield, but there is something we could suggest: Please try to find out how to interface with regular (non custom action) .NET DLLs from InstallShield scripts and then call Metabase.RegisterApplication() method defined in UltiDevCassiniServerConfiguration.dll.

UltiDevCassiniServerConfiguration.dll can work in two capacities: a) as a custom action MSI DLL - as described in our walk-through, and as a Cassini Configuration API assembly. You would be using it as an API instead of custom action DLL, if InstallShield allows it.

Please let us know if you were able to call .NET methods from InstallShield. If not, we may consider making Cassini Configuration API accessible via COM interop in the next release.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Kevin Floyd
#3 Posted : Wednesday, January 3, 2007 12:58:51 PM(UTC)
Groups: Member
Joined: 1/3/2007(UTC)
Posts: 3

I am also attempting to create an InstallShield 12 Basic MSI Installation project for UltiDev Cassini.

Armin, is there any chance you can share what you have done? I am willing to report any successes I make back to you.

UltiDev staff, is there any way to register a web page with a running Cassini service via command line? Do you know of a way in Visual Studio 2005 to create the setup project and have a single executable be the result (instead of the Setup.exe, the CassiniInstall.msi, and all the prerequisites)? This is currently the only driving factor for our decision to use the InstallShield product to create the installation.

Thanks
Kevin Floyd
Ultidev Team
#4 Posted : Wednesday, January 3, 2007 1:18:44 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)
Hi, Kevin.

Yes, it is possible to register an application with UltiDev Cassini service using UltiDevCassinWebServer2.exe (it's for ASP.NET 2.0. For 1.1 file and folder names won't have "2" and "2.0" suffixes). It's always located in "%ProgramFiles%\UltiDev\Cassini Web Server for ASP.NET [2.0]" folder. If you run it from command line with /? parameter, you'll see the usage info. Here's the snippet for the registration:
Code:
UltiDevCassinWebServer2.exe /register PhysicalAppFolder [AppGUID] [defaultDocument] [<port> | 0] [/DontKeepRunning]


NOTE: Since command line parameters required to follow that exact order, port number has to be specified in order to be able to set /DontKeepRunning. If 0 is specified as a port number, port will be selected from the pool of available ports by Cassini.

We don't think it's possible to make single EXE combining Setup.exe bootstrapper and the MSI using Visual Studio, but we do it by packaging those two into a self-extracting ZIP using WinRAR. WinRAR is very inexpensive. Such self-extracting EXE can unpack content files into temp folder and run any specified EXE after installation without displaying any WinRAR branding. From user perspective it looks exactly as if they started Setup.exe. That's how we package Cassini.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Armin Mueller
#5 Posted : Thursday, January 4, 2007 5:09:49 AM(UTC)
Groups: Member
Joined: 1/3/2007(UTC)
Posts: 2

Cool! That's it - works like a charm. The hint for Kevin also solves my problem. No fuss with "UltiDevCassiniServerConfiguration.dll". Thank you!

How comes I always try to do it the hard way first? ;-)

What I did, for those being interested in:

Create 2 setup prerequisites:
"UltiDev Cassini Web Server Explorer" and "UltiDev Cassini Web Server for ASP.NET 2.0". Install them in this order. The second depends on the first one.

Create InstallScript function for registering and unregistering with Cassini:
LaunchAppAndWait (ProgramFilesFolder^"UltiDev\\Cassini Web Server for ASP.NET 2.0\\UltiDevCassinWebServer2.exe", "/register " + INSTALLDIR^"WebApp {45A496A2-3AF5-4C57-9882-16774DA3D9D9}", LAAW_OPTION_WAIT|LAAW_OPTION_HIDDEN);

Create custom actions after InstallFinalize and use the above InstallScript functions.

Voila!
Armin
Ultidev Team
#6 Posted : Thursday, January 4, 2007 5:31:06 AM(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)
Armin, thank you for the tip!

If you ever have time to write a walk-through for packaging UltiDev Cassini using InstallShield - that would be a great help for the community. You could post it here or wherever you want - we'd just link to it. We are sure lots of InstallShield developers would be thankful for the article.

Quick note: we have updated our second post in the topic to include information on how to make Cassini assign random port and specify "Don't keep app in memory" flag at the same time by using command line parameters.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Kevin Floyd
#7 Posted : Monday, January 8, 2007 10:56:35 AM(UTC)
Groups: Member
Joined: 1/3/2007(UTC)
Posts: 3

Armin, I followed what you did and the Ultidev Cassini msi's are installed via the redistributables section in InstallShield, but when my install gets to the installscript portion where the application is registerred with Cassini, it hangs. How long does your machine take to register your app with Cassini?

UltiDev, when the Server Explorer and .NET 2 Server are installed, they start the services for Cassini. what does the UltiDevCassinWebServer2.exe do? my processes show that one is already running when I try to launch it with the parameters. Did I miss something? Does the service need to be stopped prior to running this?
Ultidev Team
#8 Posted : Monday, January 8, 2007 11:12:31 AM(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)
Kevin,

UltiDevCassinWebServer2.exe can run as both: a service and a command line utility. When it runs as a service it monitors the metabase file changes. Once metabase has changed, service restarts all applications to reflect the change done to the metabase. This way it doesn't matter how metabase file was changed: by the config API, by UltiDevCassinWebServer2.exe running in command line mode, or by being edited in Notepad: metabase change triggers apps restart (not the service restart though) and service does not need to be restarted.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Kevin Floyd
#9 Posted : Monday, January 8, 2007 11:59:11 AM(UTC)
Groups: Member
Joined: 1/3/2007(UTC)
Posts: 3

Armin & UltiDev team,

I found my problem. InstallShied has a variable that contains the directory path for where the product being installed will be on the target system. this variable contains a terminating slash character ('/'). This slash was causing the UltiDevCassinWebServer2.exe to fail.

to get around this, I created my own variable and stripped the slash off. the following is the code used in the InstallScript:
Code:
StrSub(InstallFolder, INSTALLDIR, 0, StrLength(INSTALLDIR) - 1);

where INSTALLDIR is the Installshield variable and InstallFolder is the variable I am passing to the Cassini executable.
Ultidev Team
#10 Posted : Monday, January 8, 2007 12:16:54 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)
Kevin,

we had similar situation with MSI/Visual Studio. The reason is values of built-in variable that carry paths cannot have trailing slash. It should be either omitted (which is fine if your "c:\folder\" becomes "c:\folder" without trailing slash), or if you definitely have to have the trailing slash, it should be doubled, like "c:\folder\\".

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest (11)
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.