English 中文(简体)
追溯到以前版本的ClickOnce申请,没有添加/取消方案
原标题:Rollback to previous version of a ClickOnce application without Add/Remove programs

它基本上属于标题,但我仍然进一步解释。

烟雾应用的用意是设计能够轻易安装而无需行政权利。 然而,如果将ClickOnce申请撤回到以前的版本,那么,正如微软文件所解释的那样,你必须使用Add/Remove方案特征。

问题是,在我的企业中,一项具体的政策使用户无法利用这一特征。 由于ClickOnce的申请是由用户安装的,因此,作为署长的Runing appwiz.cpl在这里赢得了笔帮助。

因此,在以前版本中还没有任何其他办法可追溯ClickOnce的申请?

Thanks for your answers.

最佳回答

You can write a small program that will do this. You can take the uninstall code found here. The uninstall will always display a dialog asking the user if he s sure. The code searches that dialog for the OK button and clicks it. You could always modify this to look for the button (I can t remember the text) that reverts a version, and select it, before clicking the OK button.

问题回答

在我以前的工作之一,我们没有给我们的用户选择是否升级;每个版本都以最低版本的形式推出。 然而,如果新版本中出现错误的话,就没有允许用户降级,这确实产生了新的副作用。

To get around this, every time we d publish a version, we would publish the same version a second time to a different location but with the version incremented twice (in other words, with a version that would be higher than the next version we d publish). In the event that we had to roll back, we just needed to copy the version from the secondary location into the primary location and overwrite the main .application file with the one from that specific version.

This does require that you be somewhat disciplined with your versioning, since the whole approach depends on the backup version being higher than the next-higher current version so that ClickOnce thinks it s actually newer. You don t want to make the version too high, since whatever version you publish to replace it must naturally have a version higher than that as well.

例如,它可能采取这样的行动:

Publish version 1.0.0 to primary location and 1.2.0 to backup location
Clients update
Publish version 1.1.0 to primary location and 1.3.0 to backup location
Clients update
Calamity ensues
Copy version 1.2.0 from backup to primary (which is, in reality, version 1.0.0)
Clients update
All is well
Publish version 1.3.0 to primary location and 1.5.0 to backup location
etc.

有两项限制:

  • As stated above, your versioning must be disciplined
  • An update that gets published after a rollback (version 1.3.0 from above) can t be rolled back from




相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签