Hi All,

I was able to resolve the issue by following the below structure:

<Directory Id="TARGETDIR" Name="SourceDir">
           <Directory Id="ENERGYSOLUTIONS" Name=".">
             <Directory Id='InstallDir' Name="$(var.installDir)">
               <Directory Id="MYWEBWEBSITE" Name="$(var.websiteDir)">
                 <Component Id="VirtDirKey" Guid="*" Win64="yes">
                  <RegistryValue Root="HKLM" 
Key="SOFTWARE\$(var.RegKeyEntry)" Name="VirtDir" Value="[VIRTDIR]" 
Type="string"/>
                 </Component>
                 <Component Id="AppPoolKey" Guid="*" Win64="yes">
                   <RegistryValue Root="HKLM" 
Key="SOFTWARE\$(var.RegKeyEntry)" Name="AppPool" Value="[APPPOOL]" 
Type="string"/>
                 </Component>
               </Directory>
             </Directory>
           </Directory>
           </Directory>
       <Property Id="VIRTUAL_DIR_VAL" Value="PFWServiceApplication" 
Secure="yes">
         <RegistrySearch Id="S.VIRTDIR" Root="HKLM" 
Key="SOFTWARE\$(var.RegKeyEntry)" Name="VirtDir" Type="raw" Win64="yes"/>
       </Property>
       <Property Id="WEB_APP_NAME" Value="PFWServiceApplication" 
Secure="yes">
         <RegistrySearch Id="S.APPPOOL" Root="HKLM" 
Key="SOFTWARE\$(var.RegKeyEntry)" Name="AppPool" Type="raw" Win64="yes"/>
       </Property>
       <Property Id="VIRTDIR" Secure="yes">
       </Property>
       <Property Id="APPPOOL" Secure="yes">
       </Property>
       <SetProperty Id="VIRTDIR" Value="[VIRTUAL_DIR_VAL]" 
After="AppSearch"></SetProperty>
       <SetProperty Id="APPPOOL" Value="[WEB_APP_NAME]" 
After="AppSearch"></SetProperty>


The following site is also good: http://www.nichesoftware.co.nz/node/633

Regards,
Suvra Jyoti
-------- Original Message --------
Subject:        [WiX-users] Fwd: Re: Uninstall removing the default Virtual 
directory and not the one user created
Date:   Tue, 25 Mar 2014 15:25:42 +0530
From:   Suvrajyoti Panda <suvrajyo...@contata.co.in>
Reply-To:       General discussion about the WiX toolset. 
<wix-users@lists.sourceforge.net>
To:     General discussion about the WiX toolset. 
<wix-users@lists.sourceforge.net>



Hi David,

I have modified the WIX source file as below:
      <Property Id="VIRTDIR" Secure="yes">
          <RegistrySearch Id="RememberVirtDirProp" Root="HKLM"
Key='SOFTWARE\Test\DemoRememberVirtDir' Type='raw'
Name='Remembered'></RegistrySearch>
        </Property>
          <SetDirectory Id="ENERGYSOLUTIONS"
Value="[WindowsVolume]$(var.rootFolder)"/>
          <Feature Id="Complete" Title="Pipeline Framework Service
Application" Level="1" Display="expand"
ConfigurableDirectory="MYWEBWEBSITE">
              <Feature Id="MainContent" Title="Pipeline Framework
Service" Description="The website content" Level="1">
                  <ComponentGroupRef Id="MyWebIssConfiguration" />
                  <ComponentGroupRef Id="MyWebWebComponents" />
              </Feature>

            <Component Directory="TARGETDIR" Win64="yes">
              <RegistryValue Root='HKLM'
Key='SOFTWARE\Test\DemoRememberVirtDir' Name='Remembered'
Value='[VIRTUAL_DIR_VAL]' Type='string' />
                  <RemoveFolder Id='CleanupApplicationFolder'
On='uninstall' />
            </Component>
          </Feature>

          <Property Id="FRAMEWORKBASEPATH">
              <RegistrySearch Id="FindFrameworkDir" Root="HKLM"
Key="SOFTWARE\Microsoft\.NETFramework" Name="InstallRoot" Type="raw"/>
          </Property>

          <Property Id="ASPNETREGIIS" >
              <DirectorySearch Path="[FRAMEWORKBASEPATH]" Depth="4"
Id="FindAspNetRegIis">
                  <FileSearch Name="aspnet_regiis.exe" MinVersion="4.0.0"/>
              </DirectorySearch>
          </Property>

          <!-- Switch ASP.NET to version 4.0 -->
        <CustomAction Id="MakeWepApp40" Execute="deferred"
Impersonate="no" Directory="MYWEBWEBSITE" ExeCommand="[ASPNETREGIIS]
-norestart -s W3SVC/1/ROOT/[WEB_APP_NAME]"  Return="check">
          Not Installed
        </CustomAction>

          <InstallExecuteSequence>
              <Custom Action="MakeWepApp40"
Before="InstallFinalize">ASPNETREGIIS AND NOT Installed</Custom>
          </InstallExecuteSequence>

          <UIRef Id="MyWebUI" />

      </Product>

The [VIRTUAL_DIR_VAL] property is defined in another Wxi template file
as below:

<Property Id="VIRTUAL_DIR_VAL" Value="PFWServiceApplication" Secure="yes">

In the source file that has the dialogs i have used the
[VIRTUAL_DIR_VAL] property as below:
<Control Id="VirtualDirEdit" Type="Edit" X="45" Y="85" Width="220"
Height="18" Property="VIRTUAL_DIR_VAL" Indirect="no" Text="{80}" />

The issue is that if i change the virtual directory value to something
like "PFWServiceApplication Test" in the UI, then while installing i am
getting the error as highlighted below:

Action 15:08:40: MakeWepApp40.
MSI (s) (78:9C) [15:08:40:779]: Executing op:
CustomActionSchedule(Action=MakeWepApp40,ActionType=3106,Source=C:\Energy 
Solutions
International\PipelineFrameworkService\PFWwebsite\,Target=C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe
-norestart -s W3SVC/1/ROOT/PFWServiceApplication,)
CustomAction MakeWepApp40 returned actual error code 1 (note this may
not be 100% accurate if translation happened inside sandbox)
MSI (s) (78:9C) [15:08:41:402]: Note: 1: 1722 2: MakeWepApp40 3:
C:\Energy Solutions International\PipelineFrameworkService\PFWwebsite\
4: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe
-norestart -s W3SVC/1/ROOT/PFWServiceApplication
Error 1722. 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. Action MakeWepApp40, location:
C:\Energy Solutions International\PipelineFrameworkService\PFWwebsite\*,
command: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe
-norestart -s W3SVC/1/ROOT/PFWServiceApplication

But if i do not change the virtual directory in the UI then there is no
issue and i can create the registry entry for remembering the virtual
directory value. Please let me know how i can solve this.

Regards,
Suvra Jyoti
-------- Original Message --------
Subject:        Re: [WiX-users] Uninstall removing the default Virtual
directory and not the one user created
Date:   Tue, 25 Mar 2014 11:58:52 +0530
From:   Suvrajyoti Panda <suvrajyo...@contata.co.in>
Reply-To:       General discussion about the WiX toolset.
<wix-users@lists.sourceforge.net>
To:     wix-users@lists.sourceforge.net



Thanks David, I will try this and let you know


On 21-03-2014 19:48, David Watson wrote:
> You need to persist the VIRTUAL_DIR_VAL (store it in the registry) so the 
> uninstaller knows it has changed otherwise it will use the default values.
>
> http://robmensching.com/blog/posts/2010/5/2/the-wix-toolsets-remember-property-pattern
>
>
> -----Original Message-----
> From: Suvrajyoti Panda [mailto:suvrajyo...@contata.co.in]
> Sent: 21 March 2014 12:53
> To: General discussion about the WiX toolset.
> Subject: [WiX-users] Uninstall removing the default Virtual directory and not 
> the one user created
>
> Hi All,
>
> I am creating virtual directory through WIX installer. The installer
> allows user to change the name of the virtual directory through a custom
> UI dialogue. The default virtual directory is PFWServiceApplication. If
> the user changes this to say PFWServiceApplication_Test then the correct
> virtual directory is created and installation works fine. But the
> uninstall removes the default virtual directory. For instance i had
> created the default virtual directory PFWServiceApplication manually for
> testing and then used the installer to create the
> PFWServiceApplication_Test virtual directory. On uninstalling the
> PFWServiceApplication gets fully removed and the for
> PFWServiceApplication_Test only the node is left under the default
> website.  What i want is that on uninstall only that virtual directory
> that i installed through the installer should be removed. Below is my code.
>
> <Fragment>
>           <?include ConfigurationInitialize.wxi ?>
>
>           <!-- Install to default web site -->
>           <iis:WebSite Id="DefaultWebSite" Description='Default Web Site'>
>               <iis:WebAddress Id="AllUnassigned" Port="80" />
>           </iis:WebSite>
>
>           <DirectoryRef Id="MYWEBWEBSITE">
>               <!-- Configuring app pool -->
>               <Component Id="MyWebAppPoolCmp"
> Guid="{9413B3CA-4CF1-4E3C-8F13-4E48291A8E22}" KeyPath="yes" Permanent="no">
>                   <iis:WebAppPool Id="MyWebAppPool" Name="[WEB_APP_NAME]"
> ManagedRuntimeVersion="v4.0" ManagedPipelineMode="Integrated" />
>               </Component>
>
>               <!-- Configure virtual dir -->
>               <Component Id="MyWebVirtualDirCmp"
> Guid="{751DEB01-ECC1-48ff-869A-65BCEE9E0528}" KeyPath="yes" Permanent="no">
>                   <iis:WebVirtualDir Id="MyWebVirtualDir"
> Alias="[VIRTUAL_DIR_VAL]" Directory="MYWEBWEBSITE" WebSite="DefaultWebSite">
>                       <iis:WebDirProperties Id="MyWebVirtDirProperties"
> AnonymousAccess="yes" BasicAuthentication="yes"
> WindowsAuthentication="yes" />
>                       <iis:WebApplication Id="MyWebWebApplication"
> Name="[VIRTUAL_DIR_VAL]" WebAppPool="MyWebAppPool" />
>                   </iis:WebVirtualDir>
>               </Component>
>           </DirectoryRef>
>
>           <ComponentGroup Id="MyWebIssConfiguration">
>               <ComponentRef Id="MyWebVirtualDirCmp" />
>               <ComponentRef Id="MyWebAppPoolCmp" />
>           </ComponentGroup>
>
>       </Fragment>
>
> The include file ConfigurationInitialize.wxi has below code:
>     <Property Id="VIRTUAL_DIR_VAL" Value="PFWServiceApplication"
> Secure="yes"/>
>
>       <!-- +++++++++++++++++++ web app name properties initialize
> ++++++++++++++++++++ -->
>       <Property Id="WEB_APP_NAME" Value="PFWServiceApplication"
> Secure="yes"/>
>
> Please provide some help on this.
>
> Regards,
> Suvra Jyoti
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
> SDL PLC confidential, all rights reserved.
> If you are not the intended recipient of this mail SDL requests and requires 
> that you delete it without acting upon or copying any of its contents, and we 
> further request that you advise us.
> SDL PLC is a public limited company registered in England and Wales.  
> Registered number: 02675207.
> Registered address: Globe House, Clivemont Road, Maidenhead, Berkshire SL6 
> 7DY, UK.
>
>
>
> This message has been scanned for malware by Websense. www.websense.com
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to