Hi Bevan,

I have modified my source file as below. In the custom dialogs that i am 
using i have disabled the edit control that shows C:\Energy Solution 
International path(that part is not attached here). That's the way i 
thought of restricting the user and in the next dialog i am allowing the 
user to change the folder that is mapped to [MYFOLDER] property.

<Product Id="*" Name="$(var.pgmName)" Language="1033" 
Version="$(var.SvnVersionBuild)" Manufacturer='$(var.ManufacturerName)' 
UpgradeCode="C54B7D5D-0E66-43E8-A770-C9750693F057">
     <Package Id="*" Keywords="Installer" Description="Installer 1.0" 
Comments='Installer' InstallerVersion='300' Languages='1033' 
Compressed='yes' SummaryCodepage='1252' InstallScope='perMachine' 
Platform='x64'/>

     <WixVariable Id="WixUILicenseRtf" Value="$(var.LicensePath)" />

     <Media Id='1' Cabinet='Tort.cab' EmbedCab='yes' DiskPrompt="CD-ROM 
#1"/>
     <Property Id='DiskPrompt' Value="Tort Installation [1]" />

     <Directory Id='TARGETDIR' Name='SourceDir'>
       <Directory Id ="DESTINATIONDIR" Name=".">
       </Directory>
         <Directory Id='ENERGYSOLUTIONS'>
             <Directory Id='TORT' Name='.'>
               <Component Id="x86RegEntPLODbPath" 
Guid="A407D5B4-61F5-4CD6-8E76-3BD1C3949FE9" Win64="no">
                 <RegistryValue Id="x86DbPathRegValue" Root="HKLM" 
Key="SOFTWARE\$(var.RegKeyEntry)" Name="$(var.dbRegName)" 
Value="[TORT]$(var.DBFolder)" Type="string" />
               </Component>
               <Component Id="x64RegEntPLODbPath" 
Guid="56AE5376-4855-4C06-BB85-F669BB0C83F4" Win64="yes">
                 <RegistryValue Id="x64DbPathRegValue" Root="HKLM" 
Key="SOFTWARE\$(var.RegKeyEntry)" Name="$(var.dbRegName)" 
Value="[TORT]$(var.DBFolder)" Type="string" />
               </Component>
               <Component Id="x86RegEntPLODataPath" 
Guid="97403372-06ED-468A-9EB6-CC34FF2279A0" Win64="no">
                 <RegistryValue Id="x86DataPathRegValue" Root="HKLM" 
Key="SOFTWARE\$(var.RegKeyEntry)" Name="$(var.dataRegName)" 
Value="[TORT]$(var.DataFolder)" Type="string" />
               </Component>
               <Component Id="x64RegEntPLODataPath" 
Guid="877F685E-97C1-4E9E-A7E0-F7342CA01BB9" Win64="yes">
                 <RegistryValue Id="x64DataPathRegValue" Root="HKLM" 
Key="SOFTWARE\$(var.RegKeyEntry)" Name="$(var.dataRegName)" 
Value="[TORT]$(var.DataFolder)" Type="string" />
               </Component>
         </Directory>
       </Directory>
     </Directory>

     <Component Id="PreferencesFile" 
Guid="{A4E1FFCE-1534-43BF-AA2B-CDFD39381720}" Directory="TARGETDIR">
       <File Id='preferences' 
Source='$(var.GuiPath)\screens\preferences.xml' KeyPath='yes'>
         <CopyFile Id='Copy_Prefs' DestinationProperty='DESTINATIONDIR'/>
       </File>
     </Component>

     <SetDirectory Id="ENERGYSOLUTIONS" 
Value="[WindowsVolume]$(var.rootFolder)"/>

     <Feature Id='Complete' Title='Tort Installer' Description='Tort 
Installer' Level='1'>
       <ComponentGroupRef Id='db'/>
       <ComponentGroupRef Id='data'/>
       <ComponentGroupRef Id='engine'/>
       <ComponentGroupRef Id='security'/>
       <ComponentGroupRef Id='gui'/>
       <ComponentRef Id="x86RegEntPLODbPath"/>
       <ComponentRef Id="x64RegEntPLODbPath" />
       <ComponentRef Id="x86RegEntPLODataPath"/>
       <ComponentRef Id="x64RegEntPLODataPath" />
       <ComponentRef Id="PreferencesFile" />
     </Feature>

     <Property Id="WIXUI_INSTALLDIR" Value="ENERGYSOLUTIONS"/>
     <Property Id="MYFOLDER" Value="PipelineOptimizer 6.0.0"/>
     <Property Id="APPNAME" Value="Energy Solutions International"/>

     <!--<UIRef Id="WixUI_InstallDir" />-->
     <UIRef Id="MyWebUI" />
     <CustomAction Id="AssignDestDir" Directory="TORT" 
Value="[WindowsVolume][APPNAME]\[MYFOLDER]"/>
     <CustomAction Id="AssignProgDataDir" Directory="DESTINATIONDIR" 
Value="[CommonAppDataFolder][APPNAME]\[MYFOLDER]"/>

     <InstallExecuteSequence>
       <Custom Action="AssignDestDir" After="CostFinalize"></Custom>
       <Custom Action="AssignProgDataDir" After="CostFinalize"></Custom>
     </InstallExecuteSequence>

   </Product>

I am now able to create the structure under the programdata folder as i 
desired. But however while i am uninstalling the folders that get 
created on install such as db, gui,security, do not get removed although 
the registry keys get removed. On inspecting the log file i could find 
the below error.

Action start 14:29:08: CostFinalize.
MSI (s) (88:78) [14:29:08:578]: Disallowing uninstallation of component: 
{A5A114B9-ECE4-4EFE-8DE7-DA07E024554A} since another client exists

I however could not find any other installation on my system. Could you 
or someone please help on this. Its urgent.

Regards,
Suvra Jyoti
On 20-03-2014 00:25, Bevan Weiss wrote:
> http://wixtoolset.org/documentation/manual/v3/howtos/files_and_registry/add_
> a_file.html
>
> Try this..
> <Directory Id="TARGETDIR" Name="SourceDir">
>      <Directory Id="ProgramFilesFolder">
>          <Directory Id="APPLICATIONROOTDIRECTORY" Name="[YOUR SILLY PROGRAM
> FILES PATH]"/>
>      </Directory>
>     <Directory Id="LocalAppDataFolder">
>          <Directory Id="DATAROOTDIRECTORY" Name="[YOUR SILLY PROGRAM DATA
> PATH]"/>
>      </Directory>
> </Directory>
>
> I've never tried providing a formatted string, so it might not work.
> If it doesn't then you'll need to essentially do the same thing but using
> some custom action to modify the runtime database.
>
> If this doesn't work, then my suggestion would be that you give up.
> If it's really that important then eventually they will hire someone that
> will make it work ;)
>
>
> Regards,
> Bevan
>
>> Date: Wed, 19 Mar 2014 20:04:41 +0530
>> From: Suvrajyoti Panda <suvrajyo...@contata.co.in>
>> Subject: Re: [WiX-users] (Gentle Reminder)Creating directory under
>>      C:\Programdata same as what the user specified in the UI dialogue
>>
>> Hi Bevan,
>>
>> Could you please provide some sample code on how to have a formatted string
> as the folder names for these two items or the custom action thing.
>> Regards,
>> Suvra Jyoti
>> On 19-03-2014 17:37, Bevan Weiss wrote:
>>> Suvrajyoti,
>>>
>>> If you allow the INSTALLDIR to be changed, then the whole thing could
>>> be different...
>>> For instance if someone changed the INSTALLDIR to be C:\, then what do
>>> you consider that the C:\ProgramData.. folder should be named?
>>>
>>> I believe that you shouldn't allow the user to select any directory
>>> they like.
>>> Instead you should give them the option (via a customised gui page) of
>>> adding on a suffix to the installer directory that you have already
>>> hardcoded.
>>> Then you can just have your two folders be:
>>> C:\Program Files ()\{Manufacturer}\{Product Name} 06.00.00 {whatever
>>> user suffix they want} And C:\ProgramData\{Manufacturer}\{Product
>>> Name} 06.00.00 {whatever user suffix they want}
>>>
>>> This is possibly do-able by just having a formatted string as the
>>> folder names for these two items.
>>> If that doesn't work due to a WiX limitation, then you should be able
>>> to perform a custom action to modify the MSI in memory database early
>>> on to get the tables right for the actual installer operation.
>>>
>>>
>>> Regards,
>>> Bevan Weiss
>>>
>>>
>>> Date: Wed, 19 Mar 2014 13:57:28 +0530
>>> From: Suvrajyoti Panda <suvrajyo...@contata.co.in>
>>> Subject: Re: [WiX-users] (Gentle Reminder)Creating directory under
>>>     C:\Programdata same as what the user specified in the UI dialogue
>>>
>>> Thanks for the elaborate explanation, it made things clearer. But the
>>> current structure that i am trying to follow is something that has
>>> been decided upon.
>>>
>>> How would i parse the INSTALLDIR value after it's been changed in the
>>> UI and isolate out the part that has changed, i mean is there some
>>> sample code that you could provide me?
>>>
>>> On 18-03-2014 22:12, Phil Wilson wrote:
>>>> If you look at the tutorial and my previous example there are just a
>>>> couple of principles here that you can use to figure out directories
>>>> in general:
>>>>
>>>> 1. The default installation folder must be a folder derived from
>>>> standard system folder properties such as [ProgramFilesFolder]. Not
>>>> only is that the correct default location, it is not hardcoded, it is
>>>> resolved at install time to the actual values, These folder
>>>> properties are automatically the right location, the right name for
>>>> non-English systems, and the right location for 32 or 64-bit systems.
>>>> So if you actually wanted to have some of your files in ProgramData
>>>> you would use [LocalAppDataFolder] as the root of the property you
>>>> use to construct your folder. The key here is that you use standard
>>>> properties to construct a property name that describes your actual
>>>> folder. Typically the default name for the main app folder is
>>>> INSTALLDIR, constructed from [ProgramFilesFolder] [Manufacturer]
>>>> [ProductName] and stick {ProductVersion] at the end if you like.
>>>> Similarly your ProgramData location could be called MYDATAFOLDER
>>>> constructed from [LocalAppDataFolder] {Manufacturer] [ProductName].
>>>> That also means, by the way, that your [ProductName] should be
>>>> Pipeline Optimizer and your [Manufacturer] property should be Energy
>>>> Solutions, so you don't need to specify the hardcoded values
>>>> everywhere. See Name and Manufacturer in the Product element.
>>>>
>>>> 2. When the actual paths are constructed from properties, they are
>>>> automatically changed to reflect the user's choioce (if any) and the
>>>> actual paths on the system. That means that for your copyfile you
>>>> always do the copy from (for example) [SourceDir] to [INSTALLDIR] and
>>>> it will always be correct. Or it could be from [SourceDir] to
>>>> [MYDATAFOLDER] and it will always be correct. The main install folder
>>>> [INSTALLDIR]  (that can be altered) is nothing to do with the
>>>> LocalAppDataFolder location, which is usually a fixed directory with
>>>> your manufacturer and product name in it.
>>>>
>>>> Having said that, and assuming I understand what you're trying to do,
>>>> I know of no built-in way to construct a custom ProgramData location
>>>> based on a UI change of INSTALLDIR. You would need to write code to
>>>> parse the INSTALLDIR value after it's been changed in the UI and
>>>> isolate out the part that has changed, and then set the property
>>>> MYDATAFOLDER to be [LocallAppDataFolder] plus whatever you parsed out
>>>> from INSTALLDIR. Your copyfile is still [SourceDir] to [MYDATAFOLDER].
>>>>
>>>> If it's the app that requires the unusual install folder and the
>>>> variable preferences file location, it's rather unusual, that's why
>>>> it's making your setup require a bunch of extra work. If you've
>>>> invented some of this, you should reconsider.
>>>>
>>>> ---------------
>>>> Phil Wilson
> ------------------------------------------------------------------------------
> 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