Re: Windows folder redirection and Assembly.GetExecutingAssembly().Location and editing a .config file at run time

2017-04-06 Thread Preet Sangha
Actually pressed send too early. >From my original question. Will windows folder redirection mean I won't be able to apply my permissions modification to a knows file location or is WFR invisible to me? regards, Preet, in Auckland NZ On 7 April 2017 at 13:35, Preet Sangha

Re: Windows folder redirection and Assembly.GetExecutingAssembly().Location and editing a .config file at run time

2017-04-06 Thread Preet Sangha
Cheers Greg regards, Preet, in Auckland NZ On 7 April 2017 at 13:19, Greg Keogh wrote: > In terms of permission I can use icacls to make the changes can't I? >> > > I'm lucky to have some installer CAs written in C# so I tweak permissions > in code. You could shell-out to

Re: Windows folder redirection and Assembly.GetExecutingAssembly().Location and editing a .config file at run time

2017-04-06 Thread Greg Keogh
> > In terms of permission I can use icacls to make the changes can't I? > I'm lucky to have some installer CAs written in C# so I tweak permissions in code. You could shell-out to the icacls command, but be careful with timing and command arguments. I forgot which of cacls utilities was the most

Re: Windows folder redirection and Assembly.GetExecutingAssembly().Location and editing a .config file at run time

2017-04-06 Thread Preet Sangha
Thanks Glen, If i owned the info then I'd definitely not be storing it there, however I'm in a double bind the information is not know until well after installation so I can edit it then. And it's not replaceable into another format as it's read by a third party component. However I'm now going

Re: Windows folder redirection and Assembly.GetExecutingAssembly().Location and editing a .config file at run time

2017-04-06 Thread Glen Harvy
Hi, What is the information you need to store? If it's paths then you could record the path in the config file and then have that path redirected to where you really install the data. Frankly, changing permissions is very simple to do so changing permissions, editing and then changing back

RE: Windows folder redirection and Assembly.GetExecutingAssembly().Location and editing a .config file at run time

2017-04-05 Thread David Kean
Assuming the design can’t be changed, I would separate the thing that modifies the configs into a separate exe that is marked as requiring elevation, you do that do that with a Windows Manifest: File -> Add New Item -> Application Manifest Change requestedExecutionLevel to the level you need.

Re: Windows folder redirection and Assembly.GetExecutingAssembly().Location and editing a .config file at run time

2017-04-05 Thread Preet Sangha
I gets worse. I now have to ensure that each client as a copy of the updated file ;-) regards, Preet, in Auckland NZ On 6 April 2017 at 12:43, Greg Keogh wrote: > Yoikes ... You've got a 3rd party config file that stuck beside the > executables in a folder that is not

Re: Windows folder redirection and Assembly.GetExecutingAssembly().Location and editing a .config file at run time

2017-04-05 Thread Greg Keogh
Yoikes ... You've got a 3rd party config file that stuck beside the executables in a folder that is not writable by normal user accounts, but you need to update it at runtime. It sounds like you're snookered as you're technically breaking the modern compliance rules. You could annotate the