Permalink
Browse files

Update deploy script.

  • Loading branch information...
1 parent 9fb3d93 commit dd7f108783cae1eafdc91d7d097e4e0882576d05 @chchwy chchwy committed Dec 1, 2016
Showing with 40 additions and 25 deletions.
  1. +40 −25 util/win-deploy.ps1
View
@@ -1,40 +1,55 @@
+
cd $PSScriptRoot
cd ..
-if ( !( Test-Path app\release\Pencil2D.exe ) )
-{
- Write-Host "Can't find Pencil2D.exe!!"
- exit( 1 );
-}
-$SrcExePath = "app\release\Pencil2D.exe"
+$msvc14_dir = "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin"
+Push-Location $msvc14_dir
+Invoke-BatchFile "vcvars64.bat"
+Pop-Location
+
+$env:Path += ";$env:QTDIR\bin";
+
+& "qmake" ("-tp","vc","-r")
+$Solution = "pencil.sln"
+$BuildType = "/t:Rebuild"
+$BuildTarget = "/p:Configuration=Release;Platform=x64"
+$Quiet = "/verbosity:minimal"
+& "msbuild" $Solution, $BuildType, $BuildTarget $Quiet
+
+# Create nightly build folder
$today = Get-Date -Format "yyyyMMdd";
Write-Host "today is $today"
-$FolderName = "Pencil2D-win-$today"
-Remove-Item -Recurse $FolderName -ErrorAction SilentlyContinue
-New-Item -ItemType Directory $FolderName
-
-Copy-Item $SrcExePath $FolderName\Pencil2D.exe
-Copy-Item "app\release\plugins" $FolderName
+$TheFolder = "Pencil2D-win64-$today"
+if ( Test-Path $TheFolder )
+{
+ Remove-Item -Recurse $TheFolder -ErrorAction Continue
+}
+New-Item -ItemType Directory $TheFolder
-# Run windeployqt
-$deployqt = $env:QTDIR + "\bin\windeployqt.exe"
-Write-Host $deployqt
+# Copy exe
+$AppExe = "app\release\Pencil2D.exe"
+Copy-Item $AppExe $TheFolder\Pencil2D.exe
-& $deployqt $FolderName\Pencil2D.exe
+# Copy plugins
+New-Item -ItemType Directory "$TheFolder\plugins"
+Copy-Item "C:\Bin\ffmpeg.exe" "$TheFolder\plugins\"
-# attach VS2013 runtime
-Copy-Item $env:windir\system32\msvcp140.dll $FolderName
-Copy-Item $env:windir\system32\vcruntime140.dll $FolderName
-Copy-Item $env:windir\system32\ucrtbase.dll $FolderName
+# Run windeployqt
+& "windeployqt.exe" $TheFolder\Pencil2D.exe
-$ZipName = $FolderName + ".zip"
+# attach VS2015 runtime
+Copy-Item $env:windir\system32\msvcp140.dll $TheFolder
+Copy-Item $env:windir\system32\vcruntime140.dll $TheFolder
+Copy-Item $env:windir\system32\ucrtbase.dll $TheFolder
-[string]$ZipExe = "C:\Program Files\7-zip\7z.exe";
-[Array]$arguments = "a", "-tzip", $ZipName, $FolderName;
+# Compress
+$TheZip = "..\" + $TheFolder + ".zip"
+[string]$7z = "C:\Program Files\7-zip\7z.exe";
+[Array]$arguments = "a", "-tzip", $TheZip, $TheFolder;
-& $ZipExe $arguments
+& $7z $arguments
-Remove-Item -Recurse $FolderName
+Remove-Item -Recurse $TheFolder

0 comments on commit dd7f108

Please sign in to comment.