Skip to content

Commit

Permalink
Add unity-tizen package (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
petemounce authored and jtcmedia committed Feb 20, 2017
1 parent f5114d6 commit 74baced
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
17 changes: 17 additions & 0 deletions unity-tizen/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$ErrorActionPreference = 'Stop';

$packageName = 'unity-tizen'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = 'https://download.unity3d.com/download_unity/88d00a7498cd/TargetSupportInstaller/UnitySetup-Tizen-Support-for-Editor-5.5.1f1.exe'
$checksum = 'b3a067d99813f9f18e9d6062dd29f651c64fe8e70b04f7ea1dea5d04bc5918c7'

$packageArgs = @{
packageName = $packageName
fileType = 'EXE'
url = $url
checksum = $checksum
silentArgs = '/S'
validExitCodes = @(0)
}

Install-ChocolateyPackage @packageArgs
31 changes: 31 additions & 0 deletions unity-tizen/unity-tizen.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>unity-tizen</id>
<version>5.5.1</version>
<packageSourceUrl>https://github.com/jtcmedia/chocolatey-packages/tree/master/unity-tizen</packageSourceUrl>
<owners>LudicrousByte</owners>
<title>Unity Tizen Target Support</title>
<authors>Unity Technologies</authors>
<projectUrl>https://unity3d.com/</projectUrl>
<iconUrl>https://cdn.rawgit.com/jtcmedia/chocolatey-packages/unity-icon/icons/unity.png</iconUrl>
<copyright>Copyright 2017 Unity Technologies</copyright>
<licenseUrl>https://unity3d.com/legal/terms-of-service/software</licenseUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<docsUrl>https://docs.unity3d.com/Manual/index.html</docsUrl>
<tags>unity admin tizen windows store .net</tags>
<summary>This package adds Tizen Target Support to Unity.</summary>
<description>
This package adds Tizen Target Support to Unity.
</description>
<releaseNotes>
* [Release Notes](https://unity3d.com/unity/whats-new/)
</releaseNotes>
<dependencies>
<dependency id="unity" version="5.5.1" />
</dependencies>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
37 changes: 37 additions & 0 deletions unity-tizen/update.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import-module au

$releases = 'https://unity3d.com/get-unity/update'


function global:au_SearchReplace {
@{
".\tools\chocolateyinstall.ps1" = @{
"(^[$]url\s*=\s*)('.*')" = "`$1'$($Latest.URL32)'"
"(^[$]checksum\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'"
}

".\unity-tizen.nuspec" = @{
"(\<dependency id=`"unity`" version=)`"([^`"]+)`"" = "`$1`"$($Latest.Version)`""
}
}
}


function global:au_GetLatest {
$download_page = Invoke-WebRequest -Uri $releases -UseBasicParsing

$regex = '.exe$'
$url = $download_page.links | ? href -match $regex | select -First 1 -expand href

$exe_ver = $url -split '-' | select -Last 1
$version = $exe_ver -split 'f' | select -First 1
$build = $url -split '/' | select -Last 1 -Skip 2

$base_url = "https://download.unity3d.com/download_unity/$build"

$url = "$base_url/TargetSupportInstaller/UnitySetup-Tizen-Support-for-Editor-$exe_ver"

return @{ URL32 = $url; Version = $version }
}

update -ChecksumFor 32

0 comments on commit 74baced

Please sign in to comment.