Textractor_test/deploy.ps1

81 lines
2.1 KiB
PowerShell
Raw Normal View History

param([string]$version)
2019-02-03 05:54:29 +08:00
cd $PSScriptRoot;
mkdir -Force -Verbose Builds;
cd Builds;
mkdir -Force -Verbose x86;
mkdir -Force -Verbose x64;
foreach ($language in @{
ENGLISH="";
SPANISH="Spanish";
SIMPLIFIED_CHINESE="Simplified-Chinese";
RUSSIAN="Russian";
TURKISH="Turkish";
INDONESIAN="Indonesian";
2019-06-20 11:19:13 +08:00
PORTUGUESE="Portuguese";
2019-10-02 18:02:21 +08:00
THAI="Thai";
}.GetEnumerator())
{
$folder = "Textractor-$($language.Value)-$version";
2019-07-20 22:03:40 +08:00
rm -Force -Recurse -Verbose $folder;
mkdir -Force -Verbose $folder;
foreach ($arch in @("x86", "x64"))
{
cd $arch;
2019-06-07 14:58:45 +08:00
$VS_arch = if ($arch -eq "x86") {"Win32"} else {"x64"};
cmake -G "Visual Studio 16 2019" -A"$VS_arch" -DVERSION="$version" -DTEXT_LANGUAGE="$($language.Key)" -DCMAKE_BUILD_TYPE="Release" ../..;
&"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv" Textractor.sln /build "Release|$VS_arch";
cd ..;
mkdir -Force -Verbose "$folder/$arch";
foreach ($file in @(
"Textractor.exe",
"TextractorCLI.exe",
"texthook.dll",
"Bing Translate.dll",
"Copy to Clipboard.dll",
"Extra Newlines.dll",
"Extra Window.dll",
"Google Translate.dll",
"Lua.dll",
"Regex Filter.dll",
2019-06-14 01:06:34 +08:00
"Remove Repeated Characters.dll",
"Remove Repeated Phrases.dll",
2019-08-08 02:05:50 +08:00
"Remove Repeated Phrases 2.dll",
2019-06-14 01:06:34 +08:00
"Remove 30 Repeated Sentences.dll",
"Replacer.dll",
2019-06-22 11:19:29 +08:00
"Thread Linker.dll"
))
{
copy -Force -Recurse -Verbose -Destination "$folder/$arch" -Path "Release_$arch/$file";
}
}
}
2019-06-22 11:19:29 +08:00
2019-07-20 22:03:40 +08:00
rm -Force -Recurse -Verbose "Runtime";
2019-06-22 11:19:29 +08:00
mkdir -Force -Verbose "Runtime";
2019-07-20 22:03:40 +08:00
foreach ($arch in @("x86", "x64"))
2019-06-22 11:19:29 +08:00
{
2019-07-20 22:03:40 +08:00
mkdir -Force -Verbose "Runtime/$arch";
foreach ($file in @(
"LoaderDll.dll",
"LocaleEmulator.dll",
"Qt5Core.dll",
"Qt5Gui.dll",
"Qt5Widgets.dll",
"platforms",
"styles"
))
2019-06-22 11:19:29 +08:00
{
copy -Force -Recurse -Verbose -Destination "Runtime/$arch/$file" -Path "Release_$arch/$file";
}
}
2019-07-20 22:03:40 +08:00
rm -Force -Recurse -Verbose "Textractor";
mkdir -Force -Verbose "Textractor";
copy -Force -Recurse -Verbose -Destination "Textractor" -Path @("Runtime/*", "Textractor--$version/*");
2019-06-22 11:19:29 +08:00
cd ..
&"C:\Program Files (x86)\Inno Setup 6\iscc.exe" -DVERSION="$version" installer.iss