How to publish multiple applications / processes with one clickonce deployment?

I need a process with administrator rights. From this question and answers it seems that there is no better way than to start a separate process. Since I would rather have a process dedicated to this, and not just run my original application in the second process for this one method only - I thought I would just create two projects in one solution in VS2010. However - when I try to deploy it - it seems that I can publish only one of them at a time. This would not be because I do not want the client to install more than one - and then there would also be a problem in determining the relative paths, etc.

I do not want both processes to run as applications. I want this to be a launch application that calls (if necessary) the second for just one method.

So, how do I have two processes with one clickonce installation?

+6
source share
3 answers

you need to reference the second (working) project from the first (main) project - and then if you go to the first project properties → Publish → Application files, you should see the second EXE as a dependency already. If not, just set the Publish Status drop-down menu to Enable.

also - I'm not sure what your goal is, but see my post here: Forcing an application to administrator privileges is a very similar problem with calling an application with administrator privileges from a ClickOnce application. Could save a few minutes.

+10
source

If you do not want the user to install more than one application, you do not need to have multiple ClickOnce deployments. What you really want is one deployment. Therefore, the ClickOnce application should be your main application, and you need to include exe from the add-on application in the ClickOnce deployment. I would do this:

Add an exe copy to the ClickOnce project, set the build action to "content" and "copy-to-output-directory" to "always copy." Then build and check the Application Files dialog box in the publication properties and make sure it displays.

Now, if you can build a solution and it creates both projects, make sure that it creates a project that exe creates first. Then add the post-build command to the ClickOnce project, which will copy it from the first project output directory to the second project output directory.

What happens is that he will build the first project, then he will build the C / O project (and copy the project of the ClickOnce exe project to the output directory), and THEN he will copy the latest version of exe from another project to the output directory of the ClickOnce project, and then will create a deployment.

I'm not an msbuild expert, but the post-build command will be something like this.

COPY / Y "$ (ProjectDir) .... \ otherproject \ bin \ release \ mynew.exe" "$ TargetDir) \ mynew.exe"

This is copying from the current project into two levels, another project, then the bin folder, and then release + mynew.exe to the assembly output directory. I will not have a directory structure in exactly another project - you will need to install it yourself. But it gives you a general idea.

+3
source

I have the same problem. can you tell me how you solved this problem?

0
source

Source: https://habr.com/ru/post/915728/


All Articles