Skip to content

Commit

Permalink
finally finished windows installer
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Mar 11, 2024
1 parent 97ed074 commit 6bb096a
Show file tree
Hide file tree
Showing 10 changed files with 644 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# binaries
/output
/build
/build-all.sh
/vendor
/*.wixobj

# workspace
go.work
2 changes: 1 addition & 1 deletion handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (w *statusResponseWriter) WriteHeader(status int) {
w.ResponseWriter.WriteHeader(status)
} else {
caller := getCaller()
log.Errorf("http: superfluous response.WriteHeader call with status %d from %s (%s:%d)",
log.Warnf("http: superfluous response.WriteHeader call with status %d from %s (%s:%d)",
status, caller.Function, path.Base(caller.File), caller.Line)
}
}
Expand Down
248 changes: 248 additions & 0 deletions images/LICENSE.rtf

Large diffs are not rendered by default.

Binary file added images/MsiBanner.bmp
Binary file not shown.
Binary file added images/MsiDialog.bmp
Binary file not shown.
Binary file added images/app.ico
Binary file not shown.
6 changes: 6 additions & 0 deletions installer/windows/Product.Loc-en.wxl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" Codepage="1252" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="Language">1033</String>

<String Id="DowngradeError">A newer version of [ProductName] is already installed.</String>
</WixLocalization>
44 changes: 44 additions & 0 deletions installer/windows/Product.Var.wxi
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<Include>
<!-- #### USER-DEFINED VARIABLES THAT DEFINED DURING BUILD #### -->
<!-- <?define Arch="$(var.Arch)" ?> -->
<?define AppVersion="$(var.BuildVersion)" ?>
<!-- Upgrade code HAS to be the same for all updates. Once you've chosen it, don't change it. -->
<?define UpgradeCode="2C6FAC6E-B40B-4179-AECF-9509FB6AECD0" ?>

<!-- #### USER-DEFINED VARIABLES #### -->
<!-- Set to 1 if you want to enable major upgrade -->
<?define EnableMajorUpgrade="1" ?>
<?define AppExeNameAmd64="go-openbmclapi-windows-amd64.exe" ?>
<?define AppExeNameArm64="go-openbmclapi-windows-arm64.exe" ?>
<!-- App Info -->
<!-- The URL for Add/Remove Programs -->
<?define InfoURL="https://github.com/LiterMC/go-openbmclapi?tab=readme-ov-file#faq" ?>
<!-- App Icon -->
<?define AppIconSource="images\app.ico" ?>
<!-- GUIDs -->
<?define GuidInstallLocation="44CEEAD0-21CD-4817-9A23-ACAD1828E73C" ?>
<?define GuidApplicationShortcut="D15002CC-6088-49A0-AD98-FF2652E135AB" ?>
<?define GuidApplicationShortcutDesktop="D92075B3-0305-4BE2-A8F9-A2C3C1943F04" ?>
<?define GuidProductId="E9C10F6F-91A3-4363-A887-0BFAFA36C385" ?>

<!-- #### DO NOT EDIT ANYTHING BELOW THIS LINE #### -->
<?if $(var.EnableMajorUpgrade) = 1 ?>
<?define ProductId = "*" ?>
<?else ?>
<?define ProductId = "$(var.GuidProductId)" ?>
<?endif ?>
<?if $(var.Arch) = amd64 ?>
<?define Win64 = "yes" ?>
<?define InstallerVersion="500" ?>
<?define AppExeName = "$(var.AppExeNameAmd64)" ?>
<?elseif $(var.Arch) = arm64 ?>
<?define Win64 = "yes" ?>
<?define InstallerVersion="500" ?>
<?define AppExeName = "$(var.AppExeNameArm64)" ?>
<?else ?>
<?define Win64 = "no" ?>
<?define InstallerVersion="300" ?>
<?endif ?>
<?define MainExeSourcePath = "output\$(var.AppExeName)" ?>
</Include>
84 changes: 84 additions & 0 deletions installer/windows/Product.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">
<?include Product.Var.wxi ?>
<Product
Id="*"
Name="Go-OpenBMCLAPI $(var.BuildTag)"
Manufacturer="https://github.com/LiterMC"
Version="$(var.AppVersion)"
UpgradeCode="$(var.UpgradeCode)"
Language="!(loc.Language)"
>
<Package
Id="*"
Keywords="Installer"
Description="Go OpenBMCLAPI Installer"
Comments="Go OpenBMCLAPI is an open source project written in Golang that implements the OpenBMCLAPI protocol."
InstallerVersion="$(var.InstallerVersion)"
Compressed="yes"
InstallScope="perUser"
Languages="1033"
/>
<Property Id="ARPCOMMENTS" Value="Go OpenBMCLAPI is an open source project written in Golang that implements the OpenBMCLAPI protocol." />
<Property Id="ARPCONTACT" Value="[email protected]" />
<Property Id="ARPREADME" Value="https://github.com/LiterMC/go-openbmclapi/" />
<Property Id="ARPHELPLINK" Value="https://github.com/LiterMC/go-openbmclapi/?tab=readme-ov-file#faq" />
<Icon Id="go_openba.ico" SourceFile="$(var.AppIconSource)" />
<Property Id="ARPPRODUCTICON" Value="go_openba.ico" />

<WixVariable Id="WixUILicenseRtf" Value="images\LICENSE.rtf" />
<WixVariable Id="WixUIBannerBmp" Value="images\MsiBanner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="images\MsiDialog.bmp" />

<MediaTemplate EmbedCab="yes" CompressionLevel="high" MaximumUncompressedMediaSize="10" />
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />

<Binary Id="RootCA.Binary" SourceFile="cert\LiterMC-RootCA.cer" />
<Binary Id="CodeSign.Binary" SourceFile="cert\LiterMC-CodeSign.cer" />

<SetDirectory Id="TARGETDIR" Value="[WindowsVolume]Users\[LogonUser]" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLDIR" Name="openbmclapi" />
</Directory>

<!-- Install certifications -->
<DirectoryRef Id="TARGETDIR">
<Component Id="InstallLiterMCRootCA" Guid="7BCC6FD0-BA24-46A1-8358-0CD2DAF0E1BE" Permanent="yes">
<iis:Certificate
Id="LiterMCRootCA"
Name="LiterMC-RootCA"
StoreLocation="currentUser"
StoreName="root"
Overwrite="yes"
BinaryKey="RootCA.Binary"
/>
</Component>
<Component Id="InstallLiterMCCodeSign" Guid="EB10C0DA-39F7-44BF-940B-4752116A8213">
<iis:Certificate
Id="LiterMCCodeSign"
Name="LiterMC-CodeSign"
StoreLocation="currentUser"
StoreName="trustedPublisher"
Overwrite="yes"
BinaryKey="CodeSign.Binary"
/>
</Component>
</DirectoryRef>
<Feature Id="Complete" Title="Install LiterMC Certifications" Level="1">
<ComponentRef Id="InstallLiterMCRootCA" />
<ComponentRef Id="InstallLiterMCCodeSign" />
</Feature>

<!-- Install files -->
<Feature
Id="Install"
Title="Go OpenBMCLAPI"
Level="1"
>
<ComponentGroupRef Id="AppFiles" />
</Feature>

<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
<UIRef Id="WixUI_InstallDir" />
</Product>
</Wix>
Loading

0 comments on commit 6bb096a

Please sign in to comment.