我们决定在 clickOnce 应用程序清单中使用 minimumRequiredVersion,现在当我们尝试在用户启动应用程序时回滚到以前的版本时,它无法启动。它说应用程序清单的版本比所需版本早,用户无法使用该应用程序。如果没有 minimumRequiredVersion,我们没有这个问题,但我们想使用它。
emilam
问问题
3372 次
4 回答
8
您必须部署具有更高版本号的新版本。没有内置的回滚功能。
于 2008-10-27T22:11:44.287 回答
2
您可以使用 Mage.exe 将您的部署清单(.application 文件扩展名)更新到更高版本,并选择之前版本的应用程序清单。就像chilltemp 说的那样,您仍然需要使用更高版本,但您不必重新部署代码。
于 2008-11-07T21:37:35.643 回答
0
如果您想将版本回滚到客户端最低要求版本之前的上一个版本,那么您需要重新安装 clickonce 应用程序。
查看此链接以了解如何在代码中完成它:ClickOnce 和 Expiring Code Signing Certificates
于 2009-07-27T09:00:37.537 回答
0
如果您知道发布者 uri 以及部署和应用程序的名称、版本语言公钥令牌和处理器架构,这可以通过反射来完成。
下面的代码将尝试回滚“coolapp.app”点击一次应用程序。如果无法回滚,它会尝试卸载它。
using System;
using System.Deployment.Application;
using System.Reflection;
namespace ClickOnceAppRollback
{
static class Program
{
///
/// The main entry point for the application.
///
static void Main()
{
string appId = string.Format("{0}#{1}, Version={2}, Culture={3}, PublicKeyToken={4}, processorArchitecture={5}/{6}, Version={7}, Culture={8}, PublicKeyToken={9}, processorArchitecture={10}, type={11}",
/*The URI location of the app*/@"http://www.microsoft.com/coolapp.exe.application",
/*The application's assemblyIdentity name*/"coolapp.app",
/*The application's assemblyIdentity version*/"10.8.62.17109",
/*The application's assemblyIdentity language*/"neutral",
/*The application's assemblyIdentity public Key Token*/"0000000000000000",
/*The application's assemblyIdentity processor architecture*/"msil",
/*The deployment's dependentAssembly name*/"coolapp.exe",
/*The deployment's dependentAssembly version*/"10.8.62.17109",
/*The deployment's dependentAssembly language*/"neutral",
/*The deployment's dependentAssembly public Key Token*/"0000000000000000",
/*The deployment's dependentAssembly processor architecture*/"msil",
/*The deployment's dependentAssembly type*/"win32");
var ctor = typeof(ApplicationDeployment).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[] { typeof(string) }, null);
var appDeployment = ctor.Invoke(new object[] { appId });
var subState = appDeployment.GetType().GetField("_subState", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(appDeployment);
var subStore = appDeployment.GetType().GetField("_subStore", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(appDeployment);
try
{
subStore.GetType().GetMethod("RollbackSubscription").Invoke(subStore, new object[] { subState });
}
catch
{
subStore.GetType().GetMethod("UninstallSubscription").Invoke(subStore, new object[] { subState });
}
}
}
}
于 2012-07-01T13:22:35.290 回答