5
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Visual Studio Installer Projectsで自作プログラムを配布するインストーラを作成しよう

Last updated at Posted at 2020-12-08

はじめに

Visual Studio Instaler Projects を使うと、Visual Studio で作成したアプリケーションだけでなく、別のツールで作成した自作のプログラムを配布することも比較的簡単にできる。今回それをやってみたい。

Visual Studio Installer Projectsのインストール手順

参考のURLを参照のこと

今回配布したいアプリ

別ツールのアプリを配布したかったが簡単に作れなかったので、以下のコテコテのWindows フォームアプリとする。

アプリ名:「Hello World」
実行ファイル名:Hello.exe
実行イメージ:

image.png

インストーラ作成してみよう

まずVisual Studioを開き、プロジェクトの種類として「Setup Project」でプロジェクトを作成する。

image.png

すると以下の画面が表示されるため、「Hello.exe」を左側の「Application Folder」にドラッグする。
ドラッグするとApplication Folderの下に「Hello.exe」が追加される。

image.png

次に「User's Programs Menu」をクリックし、右側のペインで右クリックし、「新しいショートカットの作成」をクリックする。
すると下のダイアログが表示されるため、「Application Folder」の「Hello.exe」を選択する。

image.png

するとショートカットが作成されるので、右クリックで「名前の変更」で「My Application」等と好きな名前に変更する。

ソリューションエクスプローラでプロジェクトを右クリックしてビルドをすると、"setup.exe"というインストーラができる。

インストール

setup.exeをダブルクリックして、指示に従って進めていくとアプリをインストールすることができる。

インストールが完了すると、作成したショートカットでメニューが追加されておりダブルクリックすると、アプリケーションが実行されるはずだ。
image.png

おわりに

NSIS等のように面倒なスクリプトを作成する必要がないため、複雑な処理がなくファイルをコピーする程度のインストーラであれば、これでも十分使える。

参考

5
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?