views:

120

answers:

2
+1  Q: 

.net publishing

I have a .net application and i published in the local location. while installing from the published location the application need to install in "c:\temp" how can i do this in clickonce method?

+1  A: 

ClickOnce installation always installs in the predefined user folders, the ClickOnce cache.

There is no way to install a ClickOnce program somewhere else. Neither can you decide on a different location on creation of the ClickOnce package, nor can the person installing the program decide on a different location.

This is not an omission, neither an error, it is by design and it is meant to be that way.

If you want to install in a specific location, you'll need to use some other installation method.

Sam
+1  A: 

ClickOnce installers do not install to the "Program Files" or to any specific directory (C:\temp). For security purposes, your WinForms app is in the ClickOnce cache, an obfuscated directory that differs for each ClickOnce app.

It's documented in this MSDN Library topic: ClickOnce Cache Overview (MSDN article).

If you want to get the data directory programmatically, you can use the System.Deployment namespace: ApplicationDeployment: DataDirectory Property (MSDN documentation).

splattne