-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathUpdateLibLeMPAndReinstall.bat
More file actions
59 lines (51 loc) · 1.94 KB
/
Copy pathUpdateLibLeMPAndReinstall.bat
File metadata and controls
59 lines (51 loc) · 1.94 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
@echo off
REM This script builds LeMP + the Loyc libraries, copies them into Lib\LeMP,
REM then builds the VS extension (vsix), copies it to Lib\LeMP, and starts it.
REM Note: Any previously installed vsix must first be uninstalled manually
REM from within VS.
REM
REM Works with VS 2022 and VS 2026: devenv.exe is located via vswhere instead of
REM a hard-coded path. The Loyc references in the extension are resolved from the
REM DLLs copied into Lib\LeMP below, so the "Loyc.netfx.sln" build MUST run first.
setlocal
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if not exist "%VSWHERE%" (
@echo Could not find vswhere.exe at "%VSWHERE%".
@echo Install Visual Studio 2022 or 2026, or set DEVENV manually below.
pause
goto STOP
)
REM Pick the newest installed VS (2026 sorts after 2022) that has the IDE.
for /f "usebackq delims=" %%i in (`"%VSWHERE%" -latest -prerelease -products * -property productPath`) do set "DEVENV=%%i"
if not defined DEVENV (
@echo vswhere did not report a Visual Studio installation with devenv.exe.
pause
goto STOP
)
@echo Using: "%DEVENV%"
"%DEVENV%" /out vsbuild.log /build Release "Loyc.netfx.sln"
@IF ERRORLEVEL 1 GOTO ERROR
if not exist Lib\LeMP mkdir Lib\LeMP
copy Bin\Release\*.dll Lib\LeMP
@IF ERRORLEVEL 1 GOTO ERROR
copy Bin\Release\*.exe Lib\LeMP
@IF ERRORLEVEL 1 GOTO ERROR
copy Bin\Release\*.xml Lib\LeMP
copy Bin\Release\*.pdb Lib\LeMP
copy Bin\Release\*.exe.config Lib\LeMP
"%DEVENV%" /out vsbuild.log /build Debug "Visual Studio Integration\Visual Studio Integration 2022.sln"
@IF ERRORLEVEL 1 GOTO ERROR
copy "Visual Studio Integration\LoycForVS2022\bin\Debug\LeMP_VisualStudio.vsix" "Lib\LeMP"
@IF ERRORLEVEL 1 GOTO ERROR
"Lib\LeMP\LeMP_VisualStudio.vsix"
pause
GOTO STOP
:ERROR
@echo **********************
@echo *** ERROR OCCURRED ***
@echo **********************
@if exist vsbuild.log type vsbuild.log
pause
:STOP
if exist vsbuild.log del vsbuild.log
endlocal