« 音がやっとまともに聞けました | トップページ | マウスコントロールを実装しました »

2014年10月17日 (金)

windows版インストーラを作成してみる

ちょっと道をそれまして、Inno Setupで暫定windows版インストーラを作成してみました。

まず、Inno Setupの最新版をインストールします。

http://www.jrsoftware.org/isinfo.php

インストールするとInno Setup用のスクリプトファイル(.iss)が関連付けされるので、インストーラ作成の設定を.issという拡張子で作成すればよいようです。

.issファイルがあるフォルダからの相対位置でファイルなどを指定するので、適切な位置におくようにした方がよいようです。

アタッシェケースの設定ファイルを参考に書いてみました。アイコンとかreadme.txtとかはまだないので設定していません。今はデスクトップにショートカットのみが作成されます。

qtbrynhildr.issというファイル名で作成し、同じ並びにbinフォルダを作成後本体の実行ファイルとQt5用のdllファイルを配置しました。


;----------------------------------------------------------------------
; QtBrynhildr installer script for Inno Setup
;----------------------------------------------------------------------
#define AppVer "0.08"
#define AppVerNum StringChange(AppVer, ".", "")

[Setup]
AppName=Qt Brynhildr
AppVersion={#AppVer}
AppVerName=Qt Brynhildr Ver.{#AppVer}
DefaultGroupName=Qt Brynhildr
OutputBaseFilename=qtbrynhildr-windows-{#AppVerNum}
DefaultDirName={pf}\QtBrynhildr
UsePreviousAppDir=yes
AppendDefaultDirName=yes
OutputDir=.\
TouchTime=03:15

;----------------------------------------------------------------------
; インストーラプログラム
;----------------------------------------------------------------------
VersionInfoVersion={#AppVer}
VersionInfoDescription=Qt Brynhildrをセットアップするプログラム
AppCopyright=Copyright(C) 2014 FunFun, All rights reserved.
;SetupIconFile=icon\main_icon.ico
;ウィザードページに表示されるグラフィック(*.bmp: 164 x 314)
;WizardImageFile=bmp\installer_pic.bmp
;ウィザードページに表示されるグラフィックが拡大されない
;WizardImageStretch=no
;その隙間色
;WizardImageBackColor=$ffffff
;ウィザードページの右上部分のグラフィック(*.bmp: 55 x 58)
;WizardSmallImageFile=bmp\installer_pic.bmp
;進捗表示
ShowTasksTreeLines=yes

;----------------------------------------------------------------------
;「プログラムの追加と削除」ダイアログ情報
;----------------------------------------------------------------------
;配布元
AppPublisher=FunFun @ mcz-xoxo
;アプリケーション配布元 Webサイトの URL
AppPublisherURL=http://xxxx.com/
;連絡先
AppContact=fu.aba.dc5@gmail.com
;サポートサイトURL
AppSupportURL=http://xxxx.com/support
;ReadMeファイルパス
;AppReadmeFile="{app}\readme.txt"
;製品更新先のURL
AppUpdatesURL=http://xxxx.com/software/qtbrynhildr/
;アプリケーションの説明
AppComments=A client for Brynhildr (public mode)

[Languages]
Name: japanese; MessagesFile: compiler:Languages\Japanese.isl

[Files]
Source: "bin\qtbrynhildr.exe"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "bin\icudt52.dll"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "bin\icuin52.dll"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "bin\icuuc52.dll"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "bin\libgcc_s_dw2-1.dll"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "bin\libstdc++-6.dll"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "bin\libwinpthread-1.dll"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "bin\Qt5Core.dll"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "bin\Qt5Gui.dll"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "bin\Qt5Multimedia.dll"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "bin\Qt5Network.dll"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "bin\Qt5Widgets.dll"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "bin\imageformats\qjpeg.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion touch
Source: "bin\platforms\qwindows.dll"; DestDir: "{app}\platforms"; Flags: ignoreversion touch

[Registry]
;(アンインストール時に)動作設定を削除
Root: HKCU; Subkey: "Software\mcz-xoxo\Qt Brynhildr"; Flags: uninsdeletekey

[Icons]
Name: "{commondesktop}\Qt Brynhildr"; Filename: "{app}\qtbrynhildr.exe"; WorkingDir: "{app}"; Tasks: desktopicon

[Tasks]
Name: desktopicon; Description: "デスクトップにショートカットアイコンを作成する"

この.issのファイルを作成し、エクスプローラからダブルクリックするとInno Setupが起動します。

20141017_163814

「Build」メニューから「Compile」を選ぶとインストーラの作成が開始されます。正常終了すると、.issファイルと同じフォルダにqtbrynhildr-windows-008.exeが出来上がりました。13MB程のサイズです。

Brynhildr(1.0.5)はexe+dllで400KBほどですが、インストール後サイズ48.3MBは昔なら受け入れられないですね…46.7MBはQt5のランタイムではあるのですが。

実行させるとこんな感じです。

20141017_161556


20141017_161559


20141017_161602


20141017_161605


20141017_161607


20141017_161612


アンインストールも出来ます。削除するとすべてのファイルとレジストリが削除されることを確認しました。

20141017_161624

ライセンスなどの表示のためにreadmeは追加しないといけませんねぇ。

« 音がやっとまともに聞けました | トップページ | マウスコントロールを実装しました »

コメント

コメントを書く

コメントは記事投稿者が公開するまで表示されません。

(ウェブ上には掲載しません)

トラックバック


この記事へのトラックバック一覧です: windows版インストーラを作成してみる:

« 音がやっとまともに聞けました | トップページ | マウスコントロールを実装しました »