I have a Windows Forms application that I recently re-wrote in WPF, and I need to release it to my end users. I'd like to be able to have the users go to the ClickOnce install point for the WPF application and have their Windows Forms application removed, so they don't have both on their machine.
我有一个Windows Forms应用程序,我最近在WPF中重写了,我需要将它发布给我的最终用户。我希望能够让用户转到WPF应用程序的ClickOnce安装点并删除他们的Windows窗体应用程序,因此他们的计算机上没有这两个应用程序。
What's the best way (read: easiest for users) of accomplishing this?
完成此任务的最佳方式(阅读:最简单的用户)是什么?
I have thought about creating an prerequisite command line to detect the old version and uninstall, but I would like to avoid having to write something like that where it only gets run once.
我曾考虑创建一个先决条件命令行来检测旧版本和卸载,但我想避免编写类似于只运行一次的内容。
3 个解决方案
#1
2
I think you actually SHOULD be able to deploy the WPF version as a new version of the Windows Forms application.
我认为你实际上应该能够将WPF版本部署为Windows Forms应用程序的新版本。
What version of the .NET Framework do each of the applications target?
每个应用程序的目标是什么版本的.NET Framework?
Is the assembly name on both projects the same, and is the installation URL the same? (For ClickOnce, it has nothing to do with the projectGUID.)
两个项目上的程序集名称是否相同,安装URL是否相同? (对于ClickOnce,它与projectGUID无关。)
#2
1
I haven't tried it, but could you make your WPF app directly replace your WinForms app? If you publish to the same folder, copy the right GUID's from the old project to the new project, it might just install seamlessly.
我没有尝试过,但是你可以让你的WPF应用程序直接替换你的WinForms应用程序吗?如果您发布到同一文件夹,将正确的GUID从旧项目复制到新项目,它可能只是无缝安装。
That won't remove the old versions, but every update to a ClickOnce app leaves the old versions in place.
这不会删除旧版本,但ClickOnce应用程序的每次更新都会保留旧版本。
Alternatively, can you transform your existing WinForms project into a WPF project? Is it just a different set of assembly references? I've never written a WPF app, so forgive me if this is obviously wrong.
或者,您可以将现有的WinForms项目转换为WPF项目吗?它只是一组不同的装配参考吗?我从来没有写过WPF应用程序,请原谅我,如果这显然是错误的。
#3
0
Why not simply give the new WPF application the same <ProjectGuid>
, <PublishUrl>
, etc and a higher major version number?
为什么不简单地为新的WPF应用程序提供相同的
ClickOnce won't even be aware you switched from WinForms to WPF technology.
ClickOnce甚至不会意识到您从WinForms切换到WPF技术。
Normal ClickOnce version update functionality will automatically replace the old code with the new the next time the application is updated (which can be set to happen automatically if desired).
正常的ClickOnce版本更新功能将在下次更新应用程序时自动将旧代码替换为新代码(如果需要,可以将其设置为自动发生)。
#1
2
I think you actually SHOULD be able to deploy the WPF version as a new version of the Windows Forms application.
我认为你实际上应该能够将WPF版本部署为Windows Forms应用程序的新版本。
What version of the .NET Framework do each of the applications target?
每个应用程序的目标是什么版本的.NET Framework?
Is the assembly name on both projects the same, and is the installation URL the same? (For ClickOnce, it has nothing to do with the projectGUID.)
两个项目上的程序集名称是否相同,安装URL是否相同? (对于ClickOnce,它与projectGUID无关。)
#2
1
I haven't tried it, but could you make your WPF app directly replace your WinForms app? If you publish to the same folder, copy the right GUID's from the old project to the new project, it might just install seamlessly.
我没有尝试过,但是你可以让你的WPF应用程序直接替换你的WinForms应用程序吗?如果您发布到同一文件夹,将正确的GUID从旧项目复制到新项目,它可能只是无缝安装。
That won't remove the old versions, but every update to a ClickOnce app leaves the old versions in place.
这不会删除旧版本,但ClickOnce应用程序的每次更新都会保留旧版本。
Alternatively, can you transform your existing WinForms project into a WPF project? Is it just a different set of assembly references? I've never written a WPF app, so forgive me if this is obviously wrong.
或者,您可以将现有的WinForms项目转换为WPF项目吗?它只是一组不同的装配参考吗?我从来没有写过WPF应用程序,请原谅我,如果这显然是错误的。
#3
0
Why not simply give the new WPF application the same <ProjectGuid>
, <PublishUrl>
, etc and a higher major version number?
为什么不简单地为新的WPF应用程序提供相同的
ClickOnce won't even be aware you switched from WinForms to WPF technology.
ClickOnce甚至不会意识到您从WinForms切换到WPF技术。
Normal ClickOnce version update functionality will automatically replace the old code with the new the next time the application is updated (which can be set to happen automatically if desired).
正常的ClickOnce版本更新功能将在下次更新应用程序时自动将旧代码替换为新代码(如果需要,可以将其设置为自动发生)。