简体   繁体   中英

Can I use Click Once to install shared files and if so, how?

We use Click Once to install our custom apps. But I like to design my apps as separate assemblies. For example, I just made a label and envelop printer which consists of several projects, for example, a Data Manager, Word Automation, Error Logging, ect. The Error logging is very detailed, it will log the event that initiated the call all the way down to the method that caused the actual error. It would be nice to just use the same dll and while I can with the click once, if I update the project I will have to publish every solution that uses it, quite silly indeed.

Although it may not be too bad with just error logging duplicated, but this issue will just get worse.

Is the click once just for one-offs and not for the serious developer? That would be lame since it works really well in a business as far as distribution and updating goes. From what I've seen fails in the scalable department. Unless there's something I missed. . .

I think this is not possible. The application manifest contains all the application files with their version information and hashes. Maybe you could do some dirty hacks, but this just doesn't feel right.

Sure, if you update a single project (dll) which is used in several click once applications and you manually have to publish all of these apps, I agree with you - this is not a job a developer should do.

A better way would be to setup automated builds with a release management. Or at least a nightly build for each application and a script for an automated clickonce deployment. Once you have this setup, you will not care the number of changes anymore.

The solution is to use the windows installer along with click once.

Use Both Windows Installer and ClickOnce

Here is an excerpt:

The basic concept here is to create an outer install based on Windows Installer technology. This outer install takes on the responsibility of inspecting and interrogating the system before the app is installed. It can interact with the user and gather and store configuration information, install shared assemblies to the GAC , and so forth. At uninstall time, it takes on the responsibility of cleaning up resources that ordinarily would have been left behind by our application. For example, it can uninstall files, delete log files create at runtime, uninstall services, remove assemblies from the GAC, and so on.

Plugging our ClickOnce application into our install is again a fairly simple task. Since ClickOnce apps can be activated via an Internet or intranet URL, we can simply create a shortcut on the target system that points to the application manifest. To accomplish this, we can use Windows Installer to create a .url file on the fly at install time. A .url file is a special type of shortcut that complies with the standard .ini file format.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM