2019-05-24 13:30:12 -04:00
param ( [ string ] $version )
2019-02-02 16:54:29 -05:00
2019-05-24 13:30:12 -04:00
cd $PSScriptRoot ;
mkdir -Force -Verbose Builds ;
cd Builds ;
mkdir -Force -Verbose x86 ;
mkdir -Force -Verbose x64 ;
2018-10-28 02:27:24 -04:00
2019-05-24 13:30:12 -04:00
foreach ( $language in @ {
ENGLISH = " " ;
2019-06-13 20:08:55 -04:00
SPANISH = " Spanish " ;
SIMPLIFIED_CHINESE = " Simplified-Chinese " ;
RUSSIAN = " Russian " ;
TURKISH = " Turkish " ;
INDONESIAN = " Indonesian " ;
2019-06-19 23:19:13 -04:00
PORTUGUESE = " Portuguese " ;
2019-10-02 06:02:21 -04:00
THAI = " Thai " ;
2019-10-03 16:02:02 -04:00
KOREAN = " Korean " ;
2019-05-24 13:30:12 -04:00
} . GetEnumerator ( ) )
{
2019-05-27 14:13:12 -04:00
$folder = " Textractor- $( $language . Value ) - $version " ;
2019-07-20 10:03:40 -04:00
rm -Force -Recurse -Verbose $folder ;
2019-05-24 13:30:12 -04:00
mkdir -Force -Verbose $folder ;
2019-05-27 14:13:12 -04:00
foreach ( $arch in @ ( " x86 " , " x64 " ) )
2019-05-24 13:30:12 -04:00
{
2019-05-27 14:13:12 -04:00
cd $arch ;
2019-06-07 02:58:45 -04:00
$VS_arch = if ( $arch -eq " x86 " ) { " Win32 " } else { " x64 " } ;
2020-02-06 02:52:27 -07: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 02:58:45 -04:00
& " C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv " Textractor . sln / build " Release| $VS_arch " ;
2019-05-27 14:13:12 -04:00
cd . . ;
2020-02-06 02:52:27 -07:00
& " C:\Program Files (x86)\Windows Kits\10\App Certification Kit\signtool.exe " sign / a / v / t " http://timestamp.digicert.com " / fd SHA256 " Release_ $arch /Textractor.exe " ;
& " C:\Program Files (x86)\Windows Kits\10\App Certification Kit\signtool.exe " sign / a / v / t " http://timestamp.digicert.com " / fd SHA256 " Release_ $arch /TextractorCLI.exe " ;
2019-05-27 14:13:12 -04:00
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-13 13:06:34 -04:00
" Remove Repeated Characters.dll " ,
" Remove Repeated Phrases.dll " ,
2019-08-07 14:05:50 -04:00
" Remove Repeated Phrases 2.dll " ,
2019-06-13 13:06:34 -04:00
" Remove 30 Repeated Sentences.dll " ,
2019-05-27 14:13:12 -04:00
" Replacer.dll " ,
2019-06-21 23:19:29 -04:00
" Thread Linker.dll "
2019-05-27 14:13:12 -04:00
) )
{
copy -Force -Recurse -Verbose -Destination " $folder / $arch " -Path " Release_ $arch / $file " ;
}
2019-05-24 13:30:12 -04:00
}
}
2019-06-21 23:19:29 -04:00
2019-07-20 10:03:40 -04:00
rm -Force -Recurse -Verbose " Runtime " ;
2019-06-21 23:19:29 -04:00
mkdir -Force -Verbose " Runtime " ;
2019-07-20 10:03:40 -04:00
foreach ( $arch in @ ( " x86 " , " x64 " ) )
2019-06-21 23:19:29 -04:00
{
2019-07-20 10:03:40 -04:00
mkdir -Force -Verbose " Runtime/ $arch " ;
foreach ( $file in @ (
" LoaderDll.dll " ,
" LocaleEmulator.dll " ,
" Qt5Core.dll " ,
" Qt5Gui.dll " ,
" Qt5Widgets.dll " ,
" platforms " ,
" styles "
) )
2019-06-21 23:19:29 -04:00
{
copy -Force -Recurse -Verbose -Destination " Runtime/ $arch / $file " -Path " Release_ $arch / $file " ;
}
}
2019-07-20 10:03:40 -04:00
rm -Force -Recurse -Verbose " Textractor " ;
mkdir -Force -Verbose " Textractor " ;
copy -Force -Recurse -Verbose -Destination " Textractor " -Path @ ( " Runtime/* " , " Textractor-- $version /* " ) ;
2019-06-21 23:19:29 -04:00
cd . .
2020-02-06 02:52:27 -07:00
& " C:\Program Files (x86)\Inno Setup 6\iscc " -DVERSION = " $version " installer . iss
& " 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 " ;