-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild-RSPaster.cmd
More file actions
34 lines (31 loc) · 1.53 KB
/
Copy pathBuild-RSPaster.cmd
File metadata and controls
34 lines (31 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@echo off
rem Builds RSPaster.exe with the C# compiler that ships inside Windows
rem (.NET Framework 4.x). No SDK, no download, no NuGet.
setlocal
set "CSC=%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\csc.exe"
if not exist "%CSC%" set "CSC=%WINDIR%\Microsoft.NET\Framework\v4.0.30319\csc.exe"
if not exist "%CSC%" (
echo ERROR: could not find the in-box csc.exe under %WINDIR%\Microsoft.NET
exit /b 1
)
rem The Grab feature compiles against the WinRT metadata Windows itself ships
rem and two GAC facades - all OS-provided, nothing installed. See Ocr.cs for
rem why the SDK interop assembly is deliberately absent.
set "WM=%WINDIR%\System32\WinMetadata"
set "GACM=%WINDIR%\Microsoft.NET\assembly\GAC_MSIL"
set "SR=%GACM%\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll"
set "SRIWR=%GACM%\System.Runtime.InteropServices.WindowsRuntime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.WindowsRuntime.dll"
"%CSC%" /nologo /target:winexe /optimize+ /out:"%~dp0RSPaster.exe" ^
/win32icon:"%~dp0RSPaster.ico" ^
/r:System.Windows.Forms.dll /r:System.Drawing.dll ^
/r:"%WM%\Windows.Foundation.winmd" /r:"%WM%\Windows.Media.winmd" ^
/r:"%WM%\Windows.Graphics.winmd" /r:"%WM%\Windows.Storage.winmd" ^
/r:"%WM%\Windows.Globalization.winmd" /r:"%SR%" /r:"%SRIWR%" ^
"%~dp0Themes.cs" "%~dp0KeySender.cs" "%~dp0Settings.cs" ^
"%~dp0Controls.cs" "%~dp0Phrases.cs" "%~dp0Ocr.cs" ^
"%~dp0GrabOverlay.cs" "%~dp0RSPaster.cs"
if errorlevel 1 (
echo Build FAILED.
exit /b 1
)
echo Built: %~dp0RSPaster.exe