29

.exe ファイルを作成すると、すべてが桃色になったとします。素晴らしいです。

ソフトウェアの新しい機能に取り組んでいて、古いバージョンを既に持っている人が利用できるようにしたいとします。ソフトウェアに新しいバージョンを見つけてパッチを当ててから、ビジネスに取り掛かるにはどうすればよいでしょうか。

この問題に頭を悩ませているようには見えません。

ありがとうございました。

編集: 混乱して申し訳ありませんが、よりコードに関する回答を意味していました。コードに更新を許可する必要がある特別なものはありますか?

たとえば、新しい機能を追加したい場合、既にパッケージ化されている .exe に "メソッド" を追加するにはどうすればよいですか? :Sそれは私を回転させます。

4

9 に答える 9

17

Usually the process is as follows:

  • the user starts the applicataion
  • the application launches an "updater" (another program)
  • the updater retrieves from the Internet if a newer version exists
  • if that's the case, propose the user to update
  • the users accepts, the updater downlads the new install package (that can be incremental)
  • the updater shuts the application down (or better, asks the user to do it) and launches the new installer.
  • the installation package do the rest

Of course you can have many variation, but this is the basic way to do it.

On Windows, at least, some software install an updater deamon that is always on and checks for new updates of the software it takes care (GoogleUpdater, for example).

于 2009-11-17T12:44:43.723 に答える
17

一般的な解決策は、実際には別のプロセスで必要なファイルを置き換えることです。

更新するたびに Firefox を再起動する必要があることに気づいたことがありますか? これは、別のプロセス (updater.exe) がファイルをダウンロードし、Firefox を閉じ、ファイルを置き換えてから、Firefox を再起動しているためです。

編集もちろん、これはアップデータ プログラムがチェックできる更新のリストをオンラインでホストしていることを前提としています (RSS フィード、または単純なテキスト ファイルでさえも)。

于 2009-11-17T12:38:20.353 に答える
15

You need to look at Click Once Deployment.

ClickOnce is a deployment technology that enables you to create self-updating Windows-based applications that can be installed and run with minimal user interaction. Visual Studio provides full support for publishing and updating applications deployed with ClickOnce technology if you have developed your projects with Visual Basic and Visual C#.

This creates a downloadable setup exe which you load up to the web. The user either runs this in place or downloads and runs it. This wraps your exe in the code that will check the web location (at a frequency of your choosing) for updates. If it finds one it will install it for the user.

You don't have to make any special changes to your code to enable this. beyond incrementing the version number. Just modify and extend your code as normal, compile, build, package and upload.

One thing to note is though that ClickOnce doesn't support installing applications that require administrative access:

ClickOnce deployment enables non-administrative users to install and grants only those Code Access Security permissions necessary for the application.

So if your application requires admin level access to run or even install then it's not the solution for you.

于 2009-11-17T12:39:46.617 に答える
6

1 つのアイデア - チェックを行うローダー アプリケーションを作成し、必要に応じてメイン アプリの exe を起動前に更新できますか?

于 2009-11-17T12:38:15.190 に答える
1

For windows (generally due to windows locking the .exe file while it's being executed)

  • Software determines it needs updating
  • Software runs packaged update executable (at this point Software exits)
  • Update downloads required files into some temp folder
  • Update applies patches
  • Update restarts Software
于 2009-11-17T12:39:03.003 に答える
1

Well, the usual way is that your application checks somewhere (usually on the Internet) regularly for new versions. This may be on every startup or once a week or whatever.

There you can simply put for example a text file containing the current version number. If that one would be newer than the version of the installed application you can download an updater (don't forget to sign and check signatures) and install the new version.

于 2009-11-17T12:39:45.357 に答える
1

Make your app occasionally make a request over the web to your webserver. Have that request return a file that contains the version number and a link to the newest version of your installer. If that version number is greater than the version number the currently-running program thinks it is, have your program download the new setup file and launch it.

于 2009-11-17T12:39:48.257 に答える
1

現在の .exe は変更しません。

ファイルの新しいバージョンをダウンロードする別のプロセスを起動します。新しいバージョンは古いバージョンを置き換えます。変更は必要ありません。

于 2009-11-17T13:49:58.220 に答える
0

コードの観点からは、IRun と呼ばれる単純なインターフェイスと IUpdated と呼ばれる別のインターフェイスで構成されるアプローチが好きです。

public interface IRun()
{
  public void Run();
}

public interface IUpdated()
{
  public void Update();
}

これで、私のメイン アプリケーションは、リフレクションを使用してライブラリを読み込んで「実行」し、実際のアプリケーションを起動します。

メイン アプリケーションの実行可能ファイルは、次の手順を実行します。

  1. updater.cfg を読み、提供された場所に接続し、アップデータへの更新を確認します。
  2. 更新がある場合は、更新された dll と updater.cfg をダウンロードします。
  3. リフレクション ロード updater.dll を使用し、Update() メソッドを起動します。

update メソッドは、実際のアプリケーションの更新と同じ手順を実行します。

ついに

  1. 「core.dll」をロードし、Run() メソッドを起動します。

もちろん、「自分でやりたい」場合は、ClickOnceも実際には非常に優れた方法であり、おそらくより優れていますが、制御が少なくなります。メイン アプリケーションの実行可能ファイルは、それ自体を更新する必要がないように十分にシンプルであるか、とにかく更新する必要があります。

于 2009-11-17T14:03:24.463 に答える