-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstall-Windows.cmd
More file actions
47 lines (45 loc) · 1.84 KB
/
Install-Windows.cmd
File metadata and controls
47 lines (45 loc) · 1.84 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
@echo off
REM Check for sufficient privileges
net session > nul 2>&1
if not %ERRORLEVEL% equ 0 ( echo Please run with Elevated Privileges
pause
exit /b 1
)
cd "%~dp0"
echo.
echo Patching Palm webOS SDK to add VisualStudio Code extensions . . .
set "PALM_SCRIPTS=C:\Program Files (x86)\HP webOS\SDK"
if not exist "%PALM_SCRIPTS%\vscode" (
mkdir "%PALM_SCRIPTS%\vscode"
)
if not exist "%PALM_SCRIPTS%\vscode\_scripts" (
mkdir "%PALM_SCRIPTS%\vscode\_scripts"
)
copy "%~dp0\vscode-*.bat" "%PALM_SCRIPTS%\bin\" /y >nul
copy "%~dp0\_scripts\*.bat" "%PALM_SCRIPTS%\vscode\_scripts\" /y >nul
copy "%~dp0\tasks.json" "%PALM_SCRIPTS%\vscode\tasks.json" /y >nul
REM Tell Windows not to block script execution
echo.>"%PALM_SCRIPTS%\vscode\_scripts\build.bat":Zone.Identifier
echo.>"%PALM_SCRIPTS%\vscode\_scripts\run.bat":Zone.Identifier
REM On Windows, Palm chose to force the generate script to exit as soon as the Java command was done
REM For this reason the script can't simply be patched, either the line or the whole file has to be replaced
REM It was easier just to replace the file, and since no one will probably ever update it again, that seems pretty safe
if exist "%PALM_SCRIPTS%\bin\palm-generate-original.bat" (
copy "%cd%\palm-generate-additions.bat" "%PALM_SCRIPTS%\bin\palm-generate.bat" /y >nul
echo Done! Existing Install Updated
) else (
rename "%PALM_SCRIPTS%\bin\palm-generate.bat" "palm-generate-original.bat" >nul
if exist "%PALM_SCRIPTS%\bin\palm-generate-original.bat" (
copy "%~dp0\palm-generate-additions.bat" "%PALM_SCRIPTS%\bin\palm-generate.bat" /y >nul
echo Done! Install Completed
) else (
echo Error! Could not complete install.
)
)
echo.
echo To create a VSCode-ready webOS app use:
echo palm-generate -t new_app "%userprofile%\Projects\YourNewAppName"
echo.
if "%1" neq "silent" (
pause
)