0
votes

I inherited a Windows Forms Application (.NET Framework 4) that uses ClickOnce for installation. Everything is working perfectly except I cannot seem to set the default installation path. Currently it gets installed to:

%appdata%\Local\Apps\2.0\xxx

where xxx is some randomly created path. This is causing problems with out virus scanner which is deactivating the program randomly. We cannot exclude the 2.0 directory from scanning as other programs that are not under our control also install to this folder.

I found this online:

https://social.msdn.microsoft.com/Forums/en-US/c6e3d328-1deb-49c9-99cf-98fe3830702a/where-does-clickonce-put-files?forum=winformssetup

where it states that I can set:

System.Deployment.Application.ApplicationDeployment.CurrentDeployment.DataDirectory

to set the data directory -> which might set the program directory as well?

I just cannot seem to find where I can set this path - Any ideas? I have never used ClickOnce before (and am new to Visual Studio) so please give me clear instructions.

Thanking you in advance

1
The data directory is where data files, e.g. MDF and MDB files, get stored. You can't set the install location of a ClickOnce app. They get installed to the ClickOnce cache, which is what makes them ClickOnce apps. - jmcilhinney
thank you for your response - Ursus Schneider

1 Answers

0
votes

see comment:

The data directory is where data files, e.g. MDF and MDB files, get stored. You can't set the install location of a ClickOnce app. They get installed to the ClickOnce cache, which is what makes them ClickOnce apps. – jmcilhinney