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
>
>
> On Tue, Mar 18, 2014 at 5:54 AM, Suvrajyoti Panda 
> <suvrajyo...@contata.co.in> wrote:
>> Thanks Walter for the response.
>>
>> I too understand that this is not conventional and may be not right 
>> but when i am installing the tha pplication it creates a directory 
>> C:\Energy Solutions International\PipelineOptimizer 06.00.00\gui  
>> that has an application mosquito.exe that requires this 
>> preferences.xml file under the C:\ProgramData\Energy Solutions 
>> International itself else it is showing the error "Preferences.xml 
>> not found". Thats the reason i am using the CopyFile the way I am.
>>
>> On 18-03-2014 17:22, Walter Dexter wrote:
>>> I understand what you're trying to do, but please stop and ask if it 
>>> makes sense.
>>>
>>> The format of the path under ProgramData is usually 
>>> publisher/software/files and not editable by the user.
>>>
>>> For that matter, the software should be under Program Files, 
>>> referenced by symbol, not C:\.
>>> It's a bit confusing when you say you're trying to create a 
>>> directory using <copyfile> because that's not you create 
>>> directories. It's also confusing that you have hardcoded the 
>>> directory as the Program Files folder.  Typically you use the
ProgramFilesFolder like this:
>>>
>>> http://wix.tramontana.co.hu/tutorial/getting-started/the-files-insid
>>> e
>>>
>>> and the rest of that tutorial would probably help. Then your 
>>> copyfile doesn't refer to your hardcoded path, it does a copy from 
>>> SourceDir to INSTALLFOLDER, which is the property name for the 
>>> install location chosen by the user.
>>> ---------------
>>> Phil Wilson
>>>
>>>
>>> On Thu, Mar 13, 2014 at 6:43 AM, Suvrajyoti Panda 
>>> <suvrajyo...@contata.co.in> wrote:
>>>> Guys, Please let me know if some one has any idea on the below problem.
>>>>
>>>> -------- Original Message --------
>>>> Subject:        Creating directory under C:\Programdata same as what
the
>>> user
>>>> specified in the UI dialogue
>>>> Date:   Thu, 13 Mar 2014 10:37:13 +0530
>>>> From:   Suvrajyoti Panda <suvrajyo...@contata.co.in>
>>>> To:     General discussion about the WiX toolset.
>>>> <wix-users@lists.sourceforge.net>
>>>>
>>>>
>>>>
>>>> Hi  All,
>>>>
>>>> I had appended this query in another topic, so reposting the same 
>>>> under different heading.
>>>>
>>>> I have this requirement in which i want to create directory under 
>>>> C:\Programdata same as what the user specified in the UI dialogue 
>>>> .I am trying to do that using <CopyFile>. Below is the code:
>>>>
>>>> <Property Id="CopyDestination" Value="C:\ProgramData\Energy 
>>>> Solutions International\PipelineOptimizer $(var.SvnVersion)"/>
>>>>         <Directory Id='TARGETDIR' Name='SourceDir'>
>>>>           <Directory Id='EnergySolutions' Name="Energy Solutions 
>>>> International">
>>>>            <Directory Id='TORT' Name='PipelineOptimizer
$(var.SvnVersion)'>
>>>>              </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='CopyDestination'  />
>>>>             </File>
>>>>         </Component>
>>>>         <SetDirectory Id="EnergySolutions" Value="C:\Energy 
>>>> Solutions International"/> <Property Id="WIXUI_INSTALLDIR" 
>>>> Value="TORT" />
>>>>         <UIRef Id="WixUI_InstallDir" />
>>>>
>>>> While doing the installation if the user changes the install 
>>>> directory from the one that is default(it comes out as 
>>>> PipelineOptimizer 06.00.00) to some other name, the file being 
>>>> copied using the <CopyFile> attribute is still copied to the same 
>>>> directory under the programdata as the one which is defaulted in 
>>>> the UI which is to C:\ProgramData\Energy Solutions 
>>>> International\PipelineOptimizer 06.00.00. What i want though is 
>>>> that if the user changes the directory to say PipelineOptimizer 
>>>> 06.00.00 Test, then the file should be copied to the
C:\ProgramData\Energy Solutions International\PipelineOptimizer 06.00.00
Test but this does not happen.
>>>> Is there a way i can achieve the same. I tried using custom action 
>>>> to set the property "CopyDestination" but was not able to do so. 
>>>> Please let me know if there is a solution to this if possible with some
sample code.
>>>>
>>>> Also is there a way in which we can create 2 prompts to the user 
>>>> during install. This would allow us to use the directory variable 
>>>> independent of the path so that we can use this approach for the 
>>>> ProgramData
>>> subfolder .
>>>>      i. Prompt 1: The install path. For example, the default path 
>>>> is "C:\Energy Solutions International\".
>>>>      ii.Prompt 2: The install directory. For example, the default 
>>>> directory is "PipelineOptimizer 06.00.00".
>>>>
>>>> and then use the value of the install directory somehow to copy the 
>>>> file to right location.  Is the above approach possible? Please 
>>>> help as it is urgent for me.
>>>>
>>>> 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
>>> --------------------------------------------------------------------
>>> ---------- 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
>




------------------------------

----------------------------------------------------------------------------
--
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


End of WiX-users Digest, Vol 94, Issue 95
*****************************************

------------------------------------------------------------------------------
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