1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-15 18:00:01 +00:00

Merge branch 'master' of github.com:janet-lang/janet

This commit is contained in:
Calvin Rose 2020-05-19 09:47:11 -05:00
commit 070baea3c4
6 changed files with 218 additions and 11 deletions

View File

@ -19,10 +19,6 @@ init:
install:
- set JANET_BUILD=%appveyor_repo_commit:~0,7%
- choco install nsis -y -pre --version 3.05
# Replace makensis.exe and files with special long string build. This should
# prevent issues when setting PATH during installation.
- 7z e "tools\nsis-3.05-strlen_8192.zip" -o"C:\Program Files (x86)\NSIS\" -y
- build_win all
- refreshenv
# We need to reload vcvars after refreshing
@ -48,7 +44,7 @@ artifacts:
- name: "janet-$(janet_outname)-windows-%platform%"
path: dist
type: Zip
- path: "janet-$(janet_outname)-windows-%platform%-installer.exe"
- path: "janet-$(janet_outname)-windows-%platform%-installer.msi"
type: File
deploy:

View File

@ -121,18 +121,29 @@ copy tools\jpm.bat dist\jpm.bat
@rem Create installer
janet.exe -e "(->> janet/version (peg/match ''(* :d+ `.` :d+ `.` :d+)) first print)" > build\version.txt
janet.exe -e "(print (= (os/arch) :x64))" > build\64bit.txt
janet.exe -e "(print (os/arch))" > build\arch.txt
set /p JANET_VERSION= < build\version.txt
set /p SIXTYFOUR= < build\64bit.txt
set /p BUILDARCH= < build\arch.txt
echo "JANET_VERSION is %JANET_VERSION%"
"C:\Program Files (x86)\NSIS\makensis.exe" /DVERSION=%JANET_VERSION% /DSIXTYFOUR=%SIXTYFOUR% janet-installer.nsi
if defined APPVEYOR_REPO_TAG_NAME (
set RELEASE_VERSION=%APPVEYOR_REPO_TAG_NAME%
) else (
set RELEASE_VERSION=%JANET_VERSION%
)
if defined CI (
set WIXBIN="c:\Program Files (x86)\WiX Toolset v3.11\bin\"
) else (
set WIXBIN=
)
%WIXBIN%candle.exe tools\msi\janet.wxs -arch %BUILDARCH% -out build\
%WIXBIN%light.exe "-sice:ICE38" -b tools\msi -ext WixUIExtension build\janet.wixobj -out janet-%RELEASE_VERSION%-windows-%BUILDARCH%-installer.msi
exit /b 0
@rem Run the installer. (Installs to the local user with default settings)
:INSTALL
@echo Running Installer...
FOR %%a in (janet-*-windows-*-installer.exe) DO (
%%a /S /CurrentUser
FOR %%a in (janet-*-windows-*-installer.msi) DO (
@echo Running Installer %%a...
%%a /QN
)
exit /b 0

BIN
tools/msi/JanetDialog.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
tools/msi/LICENSE.rtf Normal file

Binary file not shown.

200
tools/msi/janet.wxs Normal file
View File

@ -0,0 +1,200 @@
<?xml version="1.0" encoding="UTF-8"?>
<?define Name = "Janet" ?>
<?define Description = "The Janet Programming Language" ?>
<?define Manufacturer = "Janet-Lang.org" ?>
<?define WebPage = "https://janet-lang.org" ?>
<?ifdef env.JANET_VERSION ?>
<?define Version = "$(env.JANET_VERSION)" ?>
<?else?>
<?define Version = "0.0.0" ?>
<?endif?>
<?if $(sys.BUILDARCH)="x64" ?>
<?define UpgradeCode="712CACD6-09AA-430A-831C-80FDFFE3F9ED" ?>
<?define ProgramFilesFolder="ProgramFiles64Folder" ?>
<?define Win64="yes" ?>
<?define Arch="(x64)" ?>
<?elseif $(sys.BUILDARCH)="x86" ?>
<?define UpgradeCode="0411837a-82c4-4dc7-872b-134d0c1b0228" ?>
<?define ProgramFilesFolder="ProgramFilesFolder" ?>
<?define Win64="no" ?>
<?define Arch="(x86)" ?>
<?else ?>
<?error Unsupported value of sys.BUILDARCH=$(sys.BUILDARCH)?>
<?endif?>
<?define BaseRegKey="Software\Microsoft\$(var.Manufacturer)\$(var.Name)" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
Name="$(var.Name)"
Language="1033"
Version="$(var.Version)"
Manufacturer="$(var.Manufacturer)"
UpgradeCode="$(var.UpgradeCode)">
<Package Compressed="yes"
InstallScope="perUser"
Manufacturer="$(var.Manufacturer)"
Description="$(var.Description)" />
<MajorUpgrade DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit."/>
<MediaTemplate EmbedCab="yes" />
<Property Id="DISABLEADVTSHORTCUTS" Value="1" />
<!-- Set UI images (use the -b option to light.exe to set where these files are) -->
<WixVariable Id="WixUIBannerBmp" Value="JanetTopBanner.png" />
<WixVariable Id="WixUIDialogBmp" Value="JanetDialog.png" />
<WixVariable Id="WixUILicenseRtf" Value="LICENSE.rtf" />
<Icon Id="Janet.ico" SourceFile="assets\icon.ico" />
<!-- Add some details to Add/Remove Programs entry -->
<Property Id="ARPPRODUCTICON" Value="Janet.ico" />
<Property Id='ARPCOMMENTS'>$(var.Description)</Property>
<Property Id='ARPURLINFOABOUT'>$(var.WebPage)</Property>
<Property Id='COMPANY'>$(var.Manufacturer)</Property>
<!-- Default to per-user installs -->
<Property Id="WixAppFolder" Value="WixPerUserFolder" />
<Property Id="ApplicationFolderName" Value="$(var.Name)" />
<!-- Fix WixUI_Advanced to work with x64 -->
<CustomAction Id="WixSetDefaultPerMachineFolderPerArch"
Property="WixPerMachineFolder"
Value="[$(var.ProgramFilesFolder)][ApplicationFolderName]"
Execute="immediate"/>
<InstallExecuteSequence>
<Custom Action="WixSetDefaultPerMachineFolderPerArch" Before="WixSetPerMachineFolder" />
</InstallExecuteSequence>
<InstallUISequence>
<Custom Action="WixSetDefaultPerMachineFolderPerArch" Before="WixSetPerMachineFolder" />
</InstallUISequence>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.ProgramFilesFolder)">
<Directory Id="APPLICATIONFOLDER" Name="$(var.Name)">
<Directory Id="BinDir" Name="bin"/>
<Directory Id="CDir" Name="C"/>
<Directory Id="DocsDir" Name="docs"/>
<Directory Id="LibraryDir" Name="Library"/>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="$(var.Name)" />
</Directory>
</Directory>
<!--
Define the files to be installed.
File/@Source is relative to where this file is compiled, the root of the repository in this case.
File/@Name is the destination file name, if not set it defaults to the file name part of Source.
Component/@Directory is the Id of the destination directory - where the directory name and
hierarchy is set in the section above
-->
<ComponentGroup Id="Files">
<Component Directory="APPLICATIONFOLDER">
<File Source="README.md"/>
<RemoveFolder Id="RemoveRootDir" On="uninstall" />
</Component>
<Component Directory="APPLICATIONFOLDER">
<File Source="LICENSE"/>
</Component>
<Component Directory="APPLICATIONFOLDER">
<File Source="assets\icon.ico"/>
</Component>
<Component Directory="BinDir">
<File Source="dist\janet.exe" KeyPath="yes">
<Shortcut Id="JanetExeShortcut"
Directory="ApplicationProgramsFolder"
Name="$(var.Name)"
Description="$(var.Description)"
Icon="Janet.ico"
Advertise="yes"
WorkingDirectory="INSTALLFOLDER" />
</File>
<RemoveFolder Id="RemoveBinDir" On="uninstall" />
</Component>
<Component Directory="BinDir">
<File Source="jpm" Name="jpm.janet"/>
</Component>
<Component Directory="BinDir">
<File Source="tools\jpm.bat"/>
</Component>
<Component Directory="CDir">
<File Source="dist\janet.h"/>
<RemoveFolder Id="RemoveCDir" On="uninstall" />
</Component>
<Component Directory="CDir">
<File Source="dist\janetconf.h"/>
</Component>
<Component Directory="CDir">
<File Source="dist\janet.lib"/>
</Component>
<Component Directory="CDir">
<File Source="dist\janet.exp"/>
</Component>
<Component Directory="CDir">
<File Source="dist\janet.c"/>
</Component>
<Component Directory="CDir">
<File Source="dist\libjanet.lib"/>
</Component>
<Component Id="LibraryComponent" Directory="LibraryDir" Guid="3860e981-5f94-4002-b5d5-2d9ec0d2792d" KeyPath="yes">
<RemoveFolder Id="RemoveLibraryDir" On="uninstall" />
</Component>
<Component Id="DocsComponent" Directory="DocsDir">
<File Source="dist\doc.html" Name="docs.html" KeyPath="yes">
<Shortcut Id="JanetDocsShortcut"
Directory="ApplicationProgramsFolder"
Name="$(var.Name) Documentation"
Description="$(var.Description)"
Advertise="yes"/>
</File>
<RemoveFolder Id="RemoveDocsDir" On="uninstall" />
</Component>
</ComponentGroup>
<Component Id="StartMenu" Directory="ApplicationProgramsFolder">
<RegistryValue Root="HKMU" Key="$(var.BaseRegKey)" Name="installed" Type="integer" Value="1" KeyPath="yes" />
<RemoveFolder Id="RemoveApplicationProgramsFolder" On="uninstall" />
</Component>
<!-- This component is duplicated with different conditions so that we can set system or user environment variables -->
<Component Id="SetEnvVarsPerMachine" Directory="ApplicationProgramsFolder" Guid="57b1e1ef-89c8-4ce4-9f0f-37618677c5a4" KeyPath="yes">
<Condition>ALLUSERS=1</Condition>
<Environment Id="PATH_PERMACHINE" Name="PATH" Value="[BinDir]" Action="set" Permanent="no" System="yes" Part="last"/>
<Environment Id="JANET_BINPATH_PERMACHINE" Name="JANET_BINPATH" Value="[BinDir]" Action="set" Permanent="no" System="yes"/>
<Environment Id="JANET_PATH_PERMACHINE" Name="JANET_PATH" Value="[LibraryDir]" Action="set" Permanent="no" System="yes" />
<Environment Id="JANET_HEADERPATH_PERMACHINE" Name="JANET_HEADERPATH" Value="[CDir]" Action="set" Permanent="no" System="yes"/>
<Environment Id="JANET_LIBPATH_PERMACHINE" Name="JANET_LIBPATH" Value="[CDir]" Action="set" Permanent="no" System="yes"/>
</Component>
<Component Id="SetEnvVarsPerUser" Directory="ApplicationProgramsFolder" Guid="128be307-488b-49aa-971a-d2ae00a1a584" KeyPath="yes">
<Condition>NOT ALLUSERS=1</Condition>
<Environment Id="PATH_PERUSER" Name="PATH" Value="[BinDir]" Action="set" Permanent="no" System="no" Part="last"/>
<Environment Id="JANET_BINPATH_PERUSER" Name="JANET_BINPATH" Value="[BinDir]" Action="set" Permanent="no" System="no"/>
<Environment Id="JANET_PATH_PERUSER" Name="JANET_PATH" Value="[LibraryDir]" Action="set" Permanent="no" System="no" />
<Environment Id="JANET_HEADERPATH_PERUSER" Name="JANET_HEADERPATH" Value="[CDir]" Action="set" Permanent="no" System="no"/>
<Environment Id="JANET_LIBPATH_PERUSER" Name="JANET_LIBPATH" Value="[CDir]" Action="set" Permanent="no" System="no"/>
</Component>
<Feature Id="MainFeature" Title="$(var.Name) $(var.Version)"
Level="1" Absent="disallow" AllowAdvertise="no" InstallDefault="local"
Description="$(var.Description)">
<ComponentGroupRef Id="Files" />
<ComponentRef Id="StartMenu" />
<ComponentRef Id="SetEnvVarsPerMachine" />
<ComponentRef Id="SetEnvVarsPerUser" />
</Feature>
<UI>
<UIRef Id="WixUI_Advanced"/>
<!-- FindRelatedProducts runs before the user select the install scope, so we ask it to run again if the have changed the scope
-->
<Publish Dialog="InstallScopeDlg" Control="Next" Order="8" Event="DoAction" Value="FindRelatedProducts">WixAppFolder = "WixPerMachineFolder"</Publish>
</UI>
</Product>
</Wix>