2019-05-25 01:30:12 +08:00
param ( [ string ] $version )
2019-02-03 05:54:29 +08:00
2019-05-25 01:30:12 +08:00
cd $PSScriptRoot ;
2021-03-13 15:51:36 +08:00
mkdir -Force -Verbose builds ;
cd builds ;
2019-05-25 01:30:12 +08:00
mkdir -Force -Verbose x86 ;
mkdir -Force -Verbose x64 ;
2018-10-28 14:27:24 +08:00
2019-05-25 01:30:12 +08:00
foreach ( $language in @ {
ENGLISH = " " ;
2019-06-14 08:08:55 +08:00
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 " ;
2019-10-04 04:02:02 +08:00
KOREAN = " Korean " ;
2020-02-29 20:15:38 +08:00
ITALIAN = " Italian " ;
2020-05-15 08:35:26 +08:00
FRENCH = " French "
2019-05-25 01:30:12 +08:00
} . GetEnumerator ( ) )
{
2019-05-28 02:13:12 +08:00
$folder = " Textractor- $( $language . Value ) - $version " ;
2019-07-20 22:03:40 +08:00
rm -Force -Recurse -Verbose $folder ;
2019-05-25 01:30:12 +08:00
mkdir -Force -Verbose $folder ;
2019-05-28 02:13:12 +08:00
foreach ( $arch in @ ( " x86 " , " x64 " ) )
2019-05-25 01:30:12 +08:00
{
2019-05-28 02:13:12 +08:00
cd $arch ;
2019-06-07 14:58:45 +08:00
$VS_arch = if ( $arch -eq " x86 " ) { " Win32 " } else { " x64 " } ;
2020-02-06 17:52:27 +08:00
& " C:\Program Files\CMake\bin\cmake " -G " Visual Studio 16 2019 " -A " $VS_arch " -DVERSION = " $version " -DTEXT_LANGUAGE = " $( $language . Key ) " -DCMAKE_BUILD_TYPE = " Release " . . / . . ;
2019-06-07 14:58:45 +08:00
& " C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv " Textractor . sln / build " Release| $VS_arch " ;
2019-05-28 02:13:12 +08:00
cd . . ;
mkdir -Force -Verbose " $folder / $arch " ;
foreach ( $file in @ (
" Textractor.exe " ,
" TextractorCLI.exe " ,
2020-09-10 21:18:17 +08:00
" texthook.dll "
2019-05-28 02:13:12 +08:00
) )
{
copy -Force -Recurse -Verbose -Destination " $folder / $arch " -Path " Release_ $arch / $file " ;
}
2020-09-10 21:18:17 +08:00
foreach ( $extension in @ (
" Bing Translate " ,
" Copy to Clipboard " ,
" DeepL Translate " ,
2021-01-31 07:42:29 +08:00
" DevTools DeepL Translate " ,
2021-05-15 17:07:22 +08:00
" DevTools Papago Translate " ,
2021-05-15 01:56:09 +08:00
" DevTools Systran Translate " ,
2020-09-10 21:18:17 +08:00
" Extra Newlines " ,
" Extra Window " ,
" Google Translate " ,
" Lua " ,
" Regex Filter " ,
2021-10-19 04:57:36 +08:00
" Regex Replacer " ,
2020-09-10 21:18:17 +08:00
" Remove Repeated Characters " ,
" Remove Repeated Phrases " ,
" Remove Repeated Phrases 2 " ,
" Remove 30 Repeated Sentences " ,
" Replacer " ,
2021-01-31 07:42:29 +08:00
" Styler " ,
2020-09-10 21:18:17 +08:00
" Thread Linker "
) )
{
copy -Force -Recurse -Verbose -Destination " $folder / $arch / $extension .xdll " -Path " Release_ $arch / $extension .dll " ;
}
2019-05-25 01:30:12 +08:00
}
2021-02-22 05:15:59 +08:00
& " C:\Program Files (x86)\Windows Kits\10\App Certification Kit\signtool.exe " sign / a / v / t " http://timestamp.digicert.com " / fd SHA256 @ ( dir " $folder \**\* " ) ;
2019-05-25 01:30:12 +08:00
}
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 " ,
2021-01-31 07:42:29 +08:00
" Qt5Network.dll " ,
" Qt5WebSockets.dll " ,
2021-06-06 07:10:24 +08:00
" Qt5WinExtras.dll "
2019-07-20 22:03:40 +08:00
" Qt5Widgets.dll " ,
" platforms " ,
" styles "
) )
2019-06-22 11:19:29 +08:00
{
copy -Force -Recurse -Verbose -Destination " Runtime/ $arch / $file " -Path " Release_ $arch / $file " ;
}
2021-03-22 15:18:56 +08:00
copy -Force -Recurse -Verbose -Destination " Runtime/ $arch " -Path " C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Redist/MSVC/**/ $arch /Microsoft.VC142.CRT/* "
2019-06-22 11:19:29 +08:00
}
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 /* " ) ;
2021-11-28 19:57:16 +08:00
& " C:\Program Files\7-Zip\7z " a " Textractor- $version -Zip-Version-English-Only.zip " Textractor / . . / INSTALL_THIS_UNICODE_FONT . ttf
2019-07-20 22:03:40 +08:00
2020-02-29 20:15:38 +08:00
cd . . ;
2020-02-12 14:34:03 +08:00
& " C:\Program Files (x86)\Inno Setup 6\iscc " -DVERSION = " $version " installer . iss ;
2020-02-06 17:52:27 +08:00
& " C:\Program Files (x86)\Windows Kits\10\App Certification Kit\signtool.exe " sign / a / v / t " http://timestamp.digicert.com " / fd SHA256 " Builds/Textractor- $version -Setup.exe " ;