1

自動更新できるWindowsサービスを作っています。計画では、新しいバージョンのサービスが利用可能になったときに実行されるコンソール アプリケーションを用意する予定です。このアプリケーションは、MSI を参照して、サービスをアンインストールし、新しいバージョンで再インストールします。そのため、アプリケーション フォルダに MSI のコピーが必要です。

MSI は、インストール時に MSI 自体のコピーをアプリケーション フォルダーに配置できますか? もしそうなら、どのように?

前もって感謝します!

4

2 に答える 2

0

The approach is initially wrong.

There's a lot of opportunities to upgrade something, if a new version is available.

  1. Check them on install (some installer has autodownloader functions) - partial solution, no auto upgrade opportunity
  2. The service needs to discover new versions (background thread) - need some development [msi silent install in the background] <- prefered
  3. Centralized deploy - there are solutions for centralized install, even MS, IBM etc. has tools for this. So if a new solution is ready, then no matter what you can deploy them in your domain. <- not so cost effective, used tippicaly by large companies

+1 Also there are some ways you can do this without stopping a service. In C# you can load, and unload versioned assemblies on the fly, but makes your developer life real hard.

If you chose the 2.nd option, then you can start a "process asyncronly" from code so the installer will run with default options (search silent install) although you can define custom settings "my.msi -s config.file". The installer needs to be prepared for checking and stopping the service itself if already exists.

This is a complex story, search for some keywords I've mentioned.

于 2013-03-20T16:25:14.227 に答える
0

.msi 自体をコピーしようとするのではなく (自己参照を機能させるには実際のハックが必要です)、新しい .msi で古い .msi ファイルをアップグレードすることをお勧めします。次に、必要なのは新しい .msi だけで、古い .msi は必要ありません。

Bundleまたは、 (WiX ツールセットの Burn エンジンを使用して)に物を入れることができ、 Bundle.

于 2013-03-20T17:23:31.783 に答える