-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from Freeesia/feature/installer
インストーラー作成
- Loading branch information
Showing
8 changed files
with
131 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using WixSharp; | ||
using Path = System.IO.Path; | ||
|
||
const string App = "VdLabel"; | ||
const string ArtifactsDir = @"..\artifacts"; | ||
const string PublishDir = @"..\publish"; | ||
const string Executable = $"{App}.exe"; | ||
|
||
var exePath = Path.Combine(Environment.CurrentDirectory, ArtifactsDir, Executable); | ||
var info = FileVersionInfo.GetVersionInfo(exePath); | ||
var version = info.FileVersion; | ||
|
||
var project = new ManagedProject(App, | ||
new Dir(@$"%ProgramFiles%\StudioFreesia\{App}", | ||
new File(exePath) { AddCloseAction = true }, | ||
new Files(Path.Combine(ArtifactsDir, "*.*"), p => !p.EndsWith(Executable)))); | ||
|
||
project.RebootSupressing = RebootSupressing.Suppress; | ||
project.GUID = new("FE947636-81DB-4819-A5D9-939125903F4C"); | ||
project.Platform = Platform.x64; | ||
project.Language = "ja-JP"; | ||
project.Version = new(version); | ||
|
||
// どっちか片方しか設定できない | ||
//project.MajorUpgrade = MajorUpgrade.Default; | ||
project.MajorUpgradeStrategy = MajorUpgradeStrategy.Default; | ||
|
||
project.BackgroundImage = @"..\assets\installer_back.png"; | ||
project.ValidateBackgroundImage = false; | ||
project.BannerImage = @"..\assets\installer_bunner.png"; | ||
|
||
// ライセンスファイルの設定 | ||
project.LicenceFile = @"..\LICENSE.rtf"; | ||
|
||
// インストール後にアプリを起動するオプション | ||
project.AfterInstall += static e => | ||
{ | ||
// アンインストール時には起動しない | ||
if (!e.IsUninstalling) | ||
{ | ||
Process.Start(e.InstallDir.PathCombine(Executable)); | ||
} | ||
}; | ||
|
||
project.BuildMsi(Path.Combine(PublishDir, $"{App}-{version}.msi")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<RootNamespace>VdLavel.Wix</RootNamespace> | ||
<TargetFramework>net472</TargetFramework> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="*.msi" /> | ||
<None Remove="*.exe" /> | ||
<None Remove="**\*.wxs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="WixSharp" Version="1.25.2" /> | ||
<PackageReference Include="WixSharp.bin" Version="1.25.2" /> | ||
<PackageReference Include="WixSharp.wix.bin" Version="3.14.0.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Reference Include="System.Windows.Forms" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.