I have a web deployment project that also installs a web service using an
additional "Web Application Folder". The web deployment asks the user for a
port number and I'd like to install the web service to this port also. I have
a custom action (written in c#), so I could set the relevant Msi Property, if
only I knew how to do it. Can someone please enlighten me?
Conceptually I want to do:
[NEWWEBPROPERTY2PORT] = [TARGETPORT]
Thanks
John
C# Wrappers for the Windows Installer API:
http://www.installsite.org/pages/en/msi/tips.htm#CsharpWrapper
--
Stefan Krueger
Microsoft Windows Installer MVP
Please post your questions in the newsgroup or vist one of these web sites:
Windows Installer FAQ
http://www.msifaq.com - http://www.msifaq.de
InstallSite - Resources for Setup Developers
http://www.installsite.org
http://www.installsite.de (GERMAN)
"John Roper" <John...@discussions.microsoft.com> schrieb im Newsbeitrag
news:9C870CA2-220A-4C4D...@microsoft.com...
Thanks for the quick response. To clarify, I must:
1. Add in a wrapper library to the Msi functions (sigh).
2. Pass in the [OriginalDatabase] to my custom action in the
CustomActionData (as, say, /database="[OriginalDatabase]"
3. Extract this path using dbpath=Context.Parameters["database"];
4. Open the database using MsiOpenDatabase(dbpath)
5. Use MsiSetProperty
I must admit I'd hoped to find an easier way :-)
Best regards
John
"John Roper" <John...@discussions.microsoft.com> wrote in message
news:0E821266-62E3-40FA...@microsoft.com...
Thanks.
I've found the "Register TLB File Using VBScript", which I guess is the one
you are referring to?
I am happy to write a .vbs to set one property to be the same as another,
based on the above .vbs, but I don't know how to register the .vbs script as
a custom action in VS 2003 deployment project. Any help on this would be very
gratefully received.
Thanks
John
OK I found the one you were referring to and I can modify one of these to do
as follows:
Property("NEWWEBPROPERTY2PORT") = Property("TARGETPORT")
but I'm worried that this will happen too late to affect the installation of
my web service (NEWWEBPROPERTY2) because of what you say about deferred
actions (I'm afraid I don't know much about the windows installer).
I'm pretty sure that this won't work, as the custom action is being called
too late in the process to affect the install of the web services.
Is there a way I can get it called earlier?
I can see that the MSI supports doing custom actions earlier, but I don't
know how to add them in VS 2003 - perhaps it isn't possible. If not, can
anyone give me a solution to my problem?
I added the .vbs script as a custom action in VS 2003 and got it called, but
Session.Property("TARGETPORT") was null and trying to set NEWWEBPROPERTY2PORT
failed.
Thanks in advance
John
I tried your suggestion, but my custom action is being called too late. I
have changed my server to not have a web site on port 80. When I attempt to
install, I specify a valid port (say 82) and then the install of the web
service fails before my custom action is even called (this action would have
set the web service's port to 82 to match the main site's port). I am at a
loss to know how you are supposed to set up a second virtual directory within
a deployment project if there's no way to set the port parameter to something
appropriate. I assume that I'm going to have to look for a more flexible
front-end to the Windows Installer that allows me to do this.... Is that
right, or am I missing something?
Cheers
John
OK I understand the confusion. In the deployment project (in the files view)
I had added an additional "web folder" which installs my web service. This
has a Port Property which I want to change before it gets installed (and is
accessible as NEWWEBPROPERTY2PORT). There doesn't seem to be a way to do this
within the VS 2003 framework, as all the custom actions are deferred and
adding new UI dialogs doesn't seem to allow me to set this value. I'm
thinking of making a separate installer (perhaps I can do a merge module?)
that would install the web service. It's not great, but would provide the
necessary dialog to allow the port to be set by the person running the
installer. It's either that, or start trying to use something like ORCA, but
I've never used that and I don't really know how to integrate it into my
build. Or I re-write the whole installer using InstallShield....
So to summarize, I do want to install files. The VS 2003 deployment project
does this but will install them to a fixed virtual directory on a port I
specify in the deployment project (80). The deployment project will create
this virtual directory, but only on these defaults. There is no way to change
this and that's what I have been struggling to do.
Thanks for the help
John
--
Stefan Krueger
Microsoft Windows Installer MVP
Please post your questions in the newsgroup or vist one of these web sites:
Windows Installer FAQ
http://www.msifaq.com - http://www.msifaq.de
InstallSite - Resources for Setup Developers
http://www.installsite.org
http://www.installsite.de (GERMAN)
"John Roper" <John...@discussions.microsoft.com> schrieb im Newsbeitrag
news:EDE3BB15-6083-416B...@microsoft.com...