Default website gets removed on Uninstall

10 Messages Forum Options Options
Embed this topic
Permalink
j-mauger
Default website gets removed on Uninstall
Reply Threaded MoreMore options
Print post
Permalink
I am trying to create a virtual directory on a Website which has a port specified by a property called PORT. If PORT is 80, I create the directory on the existing DefaultWebSite.  If PORT is not 80, I create a website with that port, then create the virtual directory.  Installation and uninstallation work fine if PORT is not 80 (the newly created website gets deleted upon uninstall).  However, when the PORT is 80, the Default Web Site gets deleted on uninstall.  Here's my code:

<Directory Id='TARGETDIR' Name='SourceDir'>
      <Component Id='CreateVirtualDirectory' Guid='220FE049-2781-4A99-93DA-68B97E999E81'>
        <Condition><![CDATA[ THINCTRAX_PORT = 80 ]]></Condition>
        <WebVirtualDir Id='VirtualDirectory' Alias='[THINCTRAX_ALIAS]' Directory='THINCTRAXDIR' WebSite='DefaultWebSite'>
          <WebApplication Id='WebApplication' Name='thincTrax'>
          </WebApplication>
        </WebVirtualDir>
      </Component>

      <Component Id='CreateVirtualDirectoryOnNewWebsite' Guid='220FE049-2781-4A99-93DA-68B97E999E81'>
        <Condition><![CDATA[ THINCTRAX_PORT <> 80 ]]></Condition>
        <WebSite Id='thincTraxOnNewWebsite' Description='thincTrax' Directory='THINCTRAXDIR' ConfigureIfExists='no' AutoStart='yes' StartOnInstall='yes'   >
          <WebAddress Id='thincTraxAddress' Port='[THINCTRAX_PORT]'/>
        </WebSite>
        <WebVirtualDir Id='VirtualDirectoryOnNewWebsite' Alias='[THINCTRAX_ALIAS]' Directory='THINCTRAXDIR' WebSite='thincTraxOnNewWebsite'>
          <WebApplication Id='WebApplicationOnNewWebsite' Name='thincTrax'>
          </WebApplication>
        </WebVirtualDir>
      </Component>
</Directory>

    <WebSite Id='DefaultWebSite' Description='Default Web Site'>
      <WebAddress Id='DefaultWebSite' Port='80'/>
    </WebSite>

Is this the expected behaviour?  Thanks in advance.

Justin
Pierson Lee
Re: Default website gets removed on Uninstall
Reply Threaded MoreMore options
Print post
Permalink
Are you passing your port number in at uninstall? Does your port in your properties have a default value? Because your Virtual Directory and website are in the same component, and your GUID for both are the same, I think it is uninstalling the second component with the site creation. Look at using separate GUIDs ( so if just the VDir is installed, it is the one removed) or storing the Port number in the registry (or passing it in on uninstall).

-----Original Message-----
From: wix-users-bounces@... [mailto:wix-users-bounces@...] On Behalf Of j-mauger
Sent: Monday, August 18, 2008 10:09 AM
To: wix-users@...
Subject: [WiX-users] Default website gets removed on Uninstall


I am trying to create a virtual directory on a Website which has a port
specified by a property called PORT. If PORT is 80, I create the directory
on the existing DefaultWebSite.  If PORT is not 80, I create a website with
that port, then create the virtual directory.  Installation and
uninstallation work fine if PORT is not 80 (the newly created website gets
deleted upon uninstall).  However, when the PORT is 80, the Default Web Site
gets deleted on uninstall.  Here's my code:

<Directory Id='TARGETDIR' Name='SourceDir'>
      <Component Id='CreateVirtualDirectory'
Guid='220FE049-2781-4A99-93DA-68B97E999E81'>
        <Condition><![CDATA[ THINCTRAX_PORT = 80 ]]></Condition>
        <WebVirtualDir Id='VirtualDirectory' Alias='[THINCTRAX_ALIAS]'
Directory='THINCTRAXDIR' WebSite='DefaultWebSite'>
          <WebApplication Id='WebApplication' Name='thincTrax'>
          </WebApplication>
        </WebVirtualDir>
      </Component>

      <Component Id='CreateVirtualDirectoryOnNewWebsite'
Guid='220FE049-2781-4A99-93DA-68B97E999E81'>
        <Condition><![CDATA[ THINCTRAX_PORT <> 80 ]]></Condition>
        <WebSite Id='thincTraxOnNewWebsite' Description='thincTrax'
Directory='THINCTRAXDIR' ConfigureIfExists='no' AutoStart='yes'
StartOnInstall='yes'   >
          <WebAddress Id='thincTraxAddress' Port='[THINCTRAX_PORT]'/>
        </WebSite>
        <WebVirtualDir Id='VirtualDirectoryOnNewWebsite'
Alias='[THINCTRAX_ALIAS]' Directory='THINCTRAXDIR'
WebSite='thincTraxOnNewWebsite'>
          <WebApplication Id='WebApplicationOnNewWebsite' Name='thincTrax'>
          </WebApplication>
        </WebVirtualDir>
      </Component>
</Directory>

    <WebSite Id='DefaultWebSite' Description='Default Web Site'>
      <WebAddress Id='DefaultWebSite' Port='80'/>
    </WebSite>

Is this the expected behaviour?  Thanks in advance.

Justin

--
View this message in context: http://n2.nabble.com/Default-website-gets-removed-on-Uninstall-tp731259p731259.html
Sent from the wix-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@...
https://lists.sourceforge.net/lists/listinfo/wix-users


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@...
https://lists.sourceforge.net/lists/listinfo/wix-users
j-mauger
Re: Default website gets removed on Uninstall
Reply Threaded MoreMore options
Print post
Permalink
Thanks for the reply.

OK, I changed the GUIDs, and now the Default Web Site doesn't get removed on uninstall when the port is 80.  So far so good.  When the port is not 80, the Default Web Site gets removed on uninstall.  This must be because the port property has a default value of 80 in my script.  If I pass in the port at uninstall, the newly created web site gets deleted.  I guess I need to store the port number in the registry, and do a registry search to set the port number on uninstall.

Another thing I noticed was that if the port was not 80, and a website already existed at that port, the virtual directory would get created fine, but then the entire website would get deleted on uninstall.  Is there a way to prevent this, or at least check whether a website exists?

 
Pierson Lee
Re: Default website gets removed on Uninstall
Reply Threaded MoreMore options
Print post
Permalink
That's one of the big issues I've been trying to solve. You can probably set another  conditional if you can find a good way to check and see if the site already exists. I've been meaning to spend more time to allow a user to either A) create a new site or B) use an existing site and I haven't been able to find a easily implementable solution

-----Original Message-----
From: wix-users-bounces@... [mailto:wix-users-bounces@...] On Behalf Of j-mauger
Sent: Tuesday, August 19, 2008 9:52 AM
To: wix-users@...
Subject: Re: [WiX-users] Default website gets removed on Uninstall


Thanks for the reply.

OK, I changed the GUIDs, and now the Default Web Site doesn't get removed on
uninstall when the port is 80.  So far so good.  When the port is not 80,
the Default Web Site gets removed on uninstall.  This must be because the
port property has a default value of 80 in my script.  If I pass in the port
at uninstall, the newly created web site gets deleted.  I guess I need to
store the port number in the registry, and do a registry search to set the
port number on uninstall.

Another thing I noticed was that if the port was not 80, and a website
already existed at that port, the virtual directory would get created fine,
but then the entire website would get deleted on uninstall.  Is there a way
to prevent this, or at least check whether a website exists?


--
View this message in context: http://n2.nabble.com/Default-website-gets-removed-on-Uninstall-tp731259p733534.html
Sent from the wix-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@...
https://lists.sourceforge.net/lists/listinfo/wix-users


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@...
https://lists.sourceforge.net/lists/listinfo/wix-users
Neil Sleightholm
Re: Default website gets removed on Uninstall
Reply Threaded MoreMore options
Print post
Permalink
In reply to this post by j-mauger
>> When the port is not 80, the Default Web Site gets removed on
uninstall...
>>I guess I need to store the port number in the registry, and do a
registry search to set the port number on uninstall.

Sorry to jump in but I think the problem is that you aren't storing the
port for uninstall.

Neil

Neil Sleightholm
X2 Systems Limited
neil@...




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@...
https://lists.sourceforge.net/lists/listinfo/wix-users
misuo
Re: Default website gets removed on Uninstall
Reply Threaded MoreMore options
Print post
Permalink
In reply to this post by j-mauger
Hi,

As far as I've understood, and irrespectively of your port issue, a WebSite element under a
Component element will always create a WebSite (even if it is the "Default Web Site") and thus
also remove it on uninstall. You THINCTRAX_PORT <> 80 sniffet should not include a WebSite element
but refer to the (located) "Default Web Site".

You may also take a look at the topic 'Install virtual directory in the default IIS web site only
for selected feature?' at e.g.
http://n2.nabble.com/Install-virtual-directory-in-the-default-IIS-web-site-only-for-selected-feature--td721970.html
in which a scenario using (locating) the existing "Default Web Site" is described including the
hidden gem - of using the WiX custom action ConfigureIIs to control if IIS should be configured at
all (e.g. in the event that IIS is not available).

/Michael

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@...
https://lists.sourceforge.net/lists/listinfo/wix-users
Pierson Lee
Re: Default website gets removed on Uninstall
Reply Threaded MoreMore options
Print post
Permalink
I think he is stating that if the port isn't 80, he needs a website created otherwise, he wants to use the default.

-----Original Message-----
From: wix-users-bounces@... [mailto:wix-users-bounces@...] On Behalf Of misuo@...
Sent: Tuesday, August 19, 2008 11:24 AM
To: wix-users
Subject: Re: [WiX-users] Default website gets removed on Uninstall

Hi,

As far as I've understood, and irrespectively of your port issue, a WebSite element under a
Component element will always create a WebSite (even if it is the "Default Web Site") and thus
also remove it on uninstall. You THINCTRAX_PORT <> 80 sniffet should not include a WebSite element
but refer to the (located) "Default Web Site".

You may also take a look at the topic 'Install virtual directory in the default IIS web site only
for selected feature?' at e.g.
http://n2.nabble.com/Install-virtual-directory-in-the-default-IIS-web-site-only-for-selected-feature--td721970.html
in which a scenario using (locating) the existing "Default Web Site" is described including the
hidden gem - of using the WiX custom action ConfigureIIs to control if IIS should be configured at
all (e.g. in the event that IIS is not available).

/Michael

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@...
https://lists.sourceforge.net/lists/listinfo/wix-users


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@...
https://lists.sourceforge.net/lists/listinfo/wix-users
Luke Bakken
Re: Default website gets removed on Uninstall
Reply Threaded MoreMore options
Print post
Permalink
In reply to this post by Pierson Lee
On Tue, Aug 19, 2008 at 10:26 AM, Pierson Lee (PIE)
<Pierson.Lee@...> wrote:
> That's one of the big issues I've been trying to solve. You can probably set another  conditional if you can find a good way to check and see if the site already exists. I've been meaning to spend more time to allow a user to either A) create a new site or B) use an existing site and I haven't been able to find a easily implementable solution

I have solved this issue where I work using registry keys and
install-time flags that install component/web site combinations based
on the flags.

It's ugly as all get out but it works.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@...
https://lists.sourceforge.net/lists/listinfo/wix-users
Pierson Lee
Re: Default website gets removed on Uninstall
Reply Threaded MoreMore options
Print post
Permalink
Where in the registry are the web sites listed? If I knew where to look I could use the same flags. With IIS7 the issue is a bit less because of the ApplicationHost.Config that it uses lists all the websites.

-----Original Message-----
From: wix-users-bounces@... [mailto:wix-users-bounces@...] On Behalf Of Luke Bakken
Sent: Tuesday, August 19, 2008 11:43 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Default website gets removed on Uninstall

On Tue, Aug 19, 2008 at 10:26 AM, Pierson Lee (PIE)
<Pierson.Lee@...> wrote:
> That's one of the big issues I've been trying to solve. You can probably set another  conditional if you can find a good way to check and see if the site already exists. I've been meaning to spend more time to allow a user to either A) create a new site or B) use an existing site and I haven't been able to find a easily implementable solution

I have solved this issue where I work using registry keys and
install-time flags that install component/web site combinations based
on the flags.

It's ugly as all get out but it works.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@...
https://lists.sourceforge.net/lists/listinfo/wix-users


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@...
https://lists.sourceforge.net/lists/listinfo/wix-users
pavan gadam
Re: Default website gets removed on Uninstall
Reply Threaded MoreMore options
Print post
Permalink
Hey,

I have a similar problem. I am currently using wix 3, in which Directory
attribute is compulsary for Website Element.

I want to install webservices into the website selected by the user in a
comboBox.

If user selects a Website say "Default Website", after installation, wix
creates another instance of website with same name.

*Is there any way to create Directorty element mapped to particular
path?*If say i want to create Directorty element for directory located
in
D:\direct1\direct2\*direct3. *

<Directory Id="sampledir" Name="SampleDirectory"/>

<Component Id="WebServiceVirtualDir" Guid="
12345678-574D-4A9A-A266-5B5EC2C022B6" Permanent="yes">

<iis:WebSite Id="CCFWebsite" Description="[COMBOWEBSITEPROP]" Directory="
sampledir" ConfigureIfExists="no">

<iis:WebAddress Id="WebAddr" Port="[PORTEDITPROP]"/>

</iis:WebSite>

</Component>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@...
https://lists.sourceforge.net/lists/listinfo/wix-users