可以使用ClickOnce来部署一个本地的Delphi应用程序 [英] Is it possible to deploy a native Delphi application with ClickOnce

查看:216
本文介绍了可以使用ClickOnce来部署一个本地的Delphi应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用ClickOnce部署一个本机Delphi应用程序,而不需要用于启动Delphi应用程序的存根C#exe?

Is it possible to deploy a native Delphi application with ClickOnce without a stub C# exe that would be used to launch the Delphi application?

同样的问题适用于VB6 ,C ++和其他本机Windows应用程序。

The same question applies to VB6, C++ and other native Windows applications.

推荐答案

个人而言,我建立自己的机制来启动自我更新过程,当我的应用程序时间戳与服务器不同步。不太难,但这不是一件简单的任务。

Personally, I build my own mechanism to kick off self update process when my application timestamp is out of sync with the server. Not too difficult, but it's not a simple task.

顺便说一句,对于Delphi,您可以使用一些第三方帮助:

By the way, for Delphi you can use some thirdparty help:

http://www.tmssoftware.com/site/wupdate.asp

更新:

对于我的实现:

MyApp.EXE将以3种不同的模式运行

MyApp.EXE will run in 3 different modes


  1. MyApp.EXE没有任何参数。这将通常启动应用程序。

  1. MyApp.EXE without any argument. This will start the application typically.

1.1它的第一件事是使用服务器验证自己的文件时间。

1.1 The very first thing it does is to validate its own file-time with the server.

1.2如果需要更新,则会将更新的文件下载到名为MyApp-YYYY-MM-DD-HH-MM-SS.exe的文件

1.2 If update is required then it will download the updated file to the file named "MyApp-YYYY-MM-DD-HH-MM-SS.exe"

1.3然后它使用命令参数调用MyApp-YYYY-MM-DD-HH-MM-SS.exe

1.3 Then it invoke "MyApp-YYYY-MM-DD-HH-MM-SS.exe" with command argument

MyApp-YYYY-MM-DD-HH-MM-SS.exe  --update MyApp.EXE

1.4终止此应用程序。

1.4 Terminate this application.

1.5如果没有更新,那么应用程序将从1.1开始正常启动

1.5 If there is no update required then the application will start normally from 1.1

MyApp.EXE - 更新FILENAME。

MyApp.EXE --update "FILENAME".

2.1每100ms尝试复制自己到FILENAME,直到成功。

2.1 Try copying itself to "FILENAME" every 100ms until success.

2.2成功时调用FILENAME

2.2 Invoke "FILENAME" when it success

2.3调用FILNAME - 删除MyApp-YYYY-MM-DD-HH-MM- SS.exe删除自己。

2.3 Invoke "FILNAME --delete MyApp-YYYY-MM-DD-HH-MM-SS.exe" to delete itself.

2.4终止

MyApp.EXE - 删除 FILENAME

MyApp.EXE --delete "FILENAME"

3.1尝试删除文件FILENAME,每500ms直到成功。

3.1 Try deleting the file "FILENAME" every 500ms until success.

3.2终止

我已经将这个方案用于我的申请7年了,效果很好。调试发生错误可能会相当痛苦,因为步骤涉及许多过程。我建议你做很多跟踪记录,以便更简单的故障排除。

I've already been using this scheme for my application for 7 years and it works well. It could be quite painful to debug when things goes wrong since the steps involve many processes. I suggest you make a lot of trace logging to allow simpler trouble-shooting.

祝你好运

这篇关于可以使用ClickOnce来部署一个本地的Delphi应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆