In that Case, create a directory in %USERS%/AppData/Local/AppName.   
Move the app.config file there til after the upgrade then use a CA, as  
you stated earlier to "merge" the 2 files, alleviating the need for a  
temporary name.

Carter

Quoting Soren Dreijer <dreijer+l...@echobit.net>:

> Carter,
>
> I can't easily change the location where these changes are made. It's an
> existing codebase that happens to use the app.config, so that's sort of
> where I have to start from (sadly).
>
> At this point, I think I'll just make a custom action that does this whole
> thing and be done with it. :)
>
> / Soren
>
>
> On Tue, Mar 11, 2014 at 11:12 AM, Carter Young <ecyo...@grandecom.net>wrote:
>
>> I suggest using Jacob's Approach.  Instead of keeping the app.config
>> file, and trying all this mess with copy etc, write the changes that
>> your tool makes to the registry, and only keep the settings that don't
>> change in the app.config.  Then every major upgrade, have your app
>> read the registry values...  Takes a little bit of work and research,
>> but will save you this headache.
>>
>> Carter
>>
>> Quoting Soren Dreijer <dreijer+l...@echobit.net>:
>>
>> > The app.config is modified after installation by one of our tools. On an
>> > upgrade, I do want to install a new app.config since there could be new
>> > changes in it and I therefore need to (manually) migrate certain
>> > information from the old app.config to the new one.
>> >
>> >
>> > On Tue, Mar 11, 2014 at 10:25 AM, Hoover, Jacob
>> > <jacob.hoo...@greenheck.com>wrote:
>> >
>> >> But if it hasn't been modified then you already know what is in it.  If
>> a
>> >> user manually modifies the file, then a major upgrade should not remove
>> it.
>> >> If it was modified with XmlFile CA's or the likes, were the original
>> user
>> >> choices persisted in the registry?
>> >>
>> >> -----Original Message-----
>> >> From: Soren Dreijer [mailto:dreijer+l...@echobit.net]
>> >> Sent: Tuesday, March 11, 2014 12:12 PM
>> >> To: General discussion about the WiX toolset.
>> >> Subject: Re: [WiX-users] Generating a unique file name
>> >>
>> >> Hey Jacob,
>> >>
>> >> It's an app.config file that's part of the installation, so a major
>> >> upgrade will remove it and I'd like to make sure it's persisted so that
>> I
>> >> can migrate it as part of the upgrade flow.
>> >>
>> >> Cheers,
>> >> Soren
>> >>
>> >>
>> >> On Tue, Mar 11, 2014 at 9:30 AM, Hoover, Jacob
>> >> <jacob.hoo...@greenheck.com>wrote:
>> >>
>> >> > Taking a step back, I would have to ask why you are needing to make a
>> >> > copy of a file with a random name. If it's a user modified file, then
>> >> > an upgrade shouldn't touch it.
>> >> >
>> >> > -----Original Message-----
>> >> > From: Soren Dreijer [mailto:dreijer+l...@echobit.net]
>> >> > Sent: Monday, March 10, 2014 8:58 PM
>> >> > To: General discussion about the WiX toolset.
>> >> > Subject: Re: [WiX-users] Generating a unique file name
>> >> >
>> >> > Hi Harold,
>> >> >
>> >> > Then we're back to doing a custom action, though, which means I can do
>> >> > anything I want, including calling GetTempFilePath() directly. :)
>> >> >
>> >> > Cheers,
>> >> > Soren
>> >> >
>> >> >
>> >> > On Mon, Mar 10, 2014 at 6:00 PM, Harold Wood (H10 Capital) <
>> >> > v-wow...@microsoft.com> wrote:
>> >> >
>> >> > > Set the name as a global property, generate the name in a custom
>> >> > > action, there you can use datetime.Tostring("HHmmssffff ") to format
>> >> > > it any way you like, then put the value back into the session object
>> >> > > where you can now use it any way you like.
>> >> > >
>> >> > > -----Original Message-----
>> >> > > From: Soren Dreijer [mailto:dreijer+l...@echobit.net]
>> >> > > Sent: Monday, March 10, 2014 5:45 PM
>> >> > > To: General discussion about the WiX toolset.
>> >> > > Subject: Re: [WiX-users] Generating a unique file name
>> >> > >
>> >> > > Hi Rob,
>> >> > >
>> >> > > As far as I can tell from the docs (
>> >> > > http://msdn.microsoft.com/en-us/library/aa372079%28v=vs.85%29.aspx
>> ),
>> >> > > the format of the time might include a colon, such as 18:57:00,
>> >> > > which isn't a valid file name on Windows.
>> >> > >
>> >> > > Cheers,
>> >> > > Soren
>> >> > >
>> >> > >
>> >> > > On Mon, Mar 10, 2014 at 4:06 PM, Rob Mensching <r...@firegiant.com>
>> >> > wrote:
>> >> > >
>> >> > > > What about using [Time]?
>> >> > > > _______________________________________________________________
>> >> > > >  FireGiant  |  Dedicated support for the WiX toolset  |
>> >> > > > http://www.firegiant.com/
>> >> > > >
>> >> > > > -----Original Message-----
>> >> > > > From: Soren Dreijer [mailto:dreijer+l...@echobit.net]
>> >> > > > Sent: Monday, March 10, 2014 3:38 PM
>> >> > > > To: General discussion about the WiX toolset.
>> >> > > > Subject: Re: [WiX-users] Generating a unique file name
>> >> > > >
>> >> > > > > I don't know how you would go about Randomizing the Names, but
>> >> > > > > as long as the DestinationName contains a name different from
>> >> > > > > the SourceName the file name will be different after the copy
>> >> completes.
>> >> > > >
>> >> > > > Yes, that's pretty much the point of DestinationName. :) What I'm
>> >> > > > looking for, however, is a way to generate a unique temp file on
>> >> > > > the fly without having to shell out to a custom action that does
>> >> > > > this for me. The reason I want to do this is because I don't know
>> >> > > > what other files could potentially exist in the directory, so I
>> >> > > > want to just create a temporary unique file name similar to what
>> >> > > > GetTempFilePath() (
>> >> > > >
>> >> > > >
>> http://msdn.microsoft.com/en-us/library/windows/desktop/aa364991%2
>> >> > > > 8v
>> >> > > > =v
>> >> > > > s.85%29.aspx
>> >> > > > )
>> >> > > > does.
>> >> > > >
>> >> > > > It sounds like that might not be possible currently.
>> >> > > >
>> >> > > > Thanks though!
>> >> > > >
>> >> > > >
>> >> > > > On Mon, Mar 10, 2014 at 1:35 PM, Carter Young
>> >> > > > <ecyo...@grandecom.net>
>> >> > > > wrote:
>> >> > > >
>> >> > > > > I don't know how you would go about Randomizing the Names, but
>> >> > > > > as long as the DestinationName contains a name different from
>> >> > > > > the SourceName the file name will be different after the copy
>> >> completes.
>> >> > > > >
>> >> > > > > Quote:
>> >> > > > > SourceName:
>> >> > > > > If this attribute is not specified (and this element is not
>> >> > > > > nested under a File element or specify a FileId attribute) then
>> >> > > > > the SourceProperty attribute should be set to the name of a
>> >> > > > > property that will resolve to the full path of the source
>> >> > > > > filename. If the value of this attribute contains a "*" wildcard
>> >> > > > > and the DestinationName attribute is specified, all moved or
>> >> > > > > copied files retain the file names from their sources.
>> >> > > > >
>> >> > > > > Quote:
>> >> > > > > DestinationName:
>> >> > > > > In prior versions of the WiX toolset, this attribute specified
>> >> > > > > the short file name. Now set this value to the localizable name
>> >> > > > > to be given to the original file after it is moved or copied. If
>> >> > > > > this attribute is not specified, then the destination file is
>> >> > > > > given the same name as the source file. If a short file name is
>> >> > > > > specified, the DestinationShortName attribute may not be
>> >> > > > > specified. If a long file name is specified, the
>> >> > > > > DestinationLongName attribute may not be specified. Also, if
>> >> > > > > this value is a long file name, the DestinationShortName
>> >> > > > > attribute may be omitted to allow WiX to attempt to generate a
>> >> > > > > unique short file name. However, if this name collides with
>> >> > > > > another file or you wish to manually specify the short file
>> >> > > > > name, then the DestinationShortName attribute may be
>> >> > specified.
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > > Quoting Soren Dreijer <dreijer+l...@echobit.net>:
>> >> > > > >
>> >> > > > > > Hey Carter,
>> >> > > > > >
>> >> > > > > > That's not quite what I'm after (unless I'm misreading the
>> docs).
>> >> > > > > > I want the *destination* file name to be uniquely generated,
>> >> > > > > > and as far as I can tell from the docs, only a unique short
>> >> > > > > > name will be generated if one
>> >> > > > > isn't
>> >> > > > > > provided.
>> >> > > > > >
>> >> > > > > > Cheers,
>> >> > > > > > SOren
>> >> > > > > >
>> >> > > > > >
>> >> > > > > > On Mon, Mar 10, 2014 at 11:28 AM, Carter Young
>> >> > > > > ><ecyo...@grandecom.net
>> >> > > > > >wrote:
>> >> > > > > >
>> >> > > > > >> I believe the SourceName Attribute is what you're looking
>> for.
>> >> > > > > >>
>> >> > > > > >>
>> http://wixtoolset.org/documentation/manual/v3/xsd/wix/copyfile.
>> >> > > > > >> ht
>> >> > > > > >> ml
>> >> > > > > >>
>> >> > > > > >> Carter
>> >> > > > > >>
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > > ----------------------------------------------------------------
>> >> > > > > --
>> >> > > > > --
>> >> > > > > --
>> >> > > > > -------- 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
>> >> >
>> >> >
>> >> > ----------------------------------------------------------------------
>> >> > -------- 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
>
>




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