Skip to content

Commit fad9e26

Browse files
committed
feat: improve compilation workflow
1 parent 189b8ff commit fad9e26

File tree

7 files changed

+76
-3
lines changed

7 files changed

+76
-3
lines changed

build/BatCodeCheck.exe

-67 KB
Binary file not shown.

build/EasyWinSetup.exe

217 KB
Binary file not shown.

build/bat2exe.exe

-1.07 MB
Binary file not shown.

scripts/compile.bat

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
@echo off
2+
3+
rem Path variables
4+
set "bat2exeUrl=https://github.com/islamadel/bat2exe/releases/latest/download/bat2exe.exe"
5+
set "bat2exeExePath=%tmp%\bat2exe.exe"
6+
set batdir=%~dp0
7+
set "srcDirPath=%batdir%..\src"
8+
set "buildDirPath=%batdir%..\build"
9+
set "generatedExePath=%buildDirPath%\setup.exe"
10+
set "finalExeName=EasyWinSetup.exe"
11+
set "finalExePath=%buildDirPath%\%finalExeName%"
12+
set B2E_WS="%tmp%\BAT2EXE_WS.ini"
13+
set B2E_TF="%tmp%\BAT2EXE_TF.ini"
14+
15+
goto execute
16+
exit /b
17+
18+
:execute
19+
set "bat2exeExe="
20+
call :getBat2exeExe
21+
if not defined bat2exeExe (
22+
call :installBat2exe
23+
)
24+
25+
if exist "%finalExePath%" del /F /Q "%finalExePath%"
26+
if not exist "%buildDirPath%" mkdir "%buildDirPath%"
27+
28+
@echo %srcDirPath%> %B2E_WS%
29+
@echo %buildDirPath%> %B2E_TF%
30+
31+
%bat2exeExe%
32+
33+
rename "%generatedExePath%" "%finalExeName%"
34+
35+
exit /b
36+
37+
:getbat2exeexe
38+
rem Check if optimizer exe exists
39+
for %%X in (%bat2exeExePath%) do (set bat2exeFound=%%~$PATH:X)
40+
if defined bat2exeFound (
41+
set bat2exeExe="%bat2exeFound%"
42+
exit /b 0
43+
) else (
44+
exit /b 4
45+
)
46+
47+
:installBat2exe
48+
setlocal EnableDelayedExpansion
49+
call :execPowershellCmd "(New-Object System.Net.WebClient).DownloadFile('^!bat2exeUrl^!', '^!bat2exeExePath^!')"
50+
endlocal
51+
52+
set "bat2exeExe="
53+
call :getBat2exeExe
54+
if not defined bat2exeExe (
55+
echo "An unexpected error occured udring installation, bat2exe executable file does exist"
56+
exit /b 1
57+
)
58+
59+
exit /b
60+
61+
:execPowershellCmd
62+
@echo off
63+
setlocal EnableDelayedExpansion
64+
65+
set errorlevel=
66+
powershell -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command %1
67+
if !errorlevel! neq 0 (
68+
endLocal
69+
echo Press any key to exit...
70+
pause >nul
71+
goto :halt
72+
)
73+
74+
endLocal
75+
exit /b
File renamed without changes.

src/config/initial-setup.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
### Require administrator privileges ###
99
RequireAdmin
1010

11+
1112
### Privacy Tweaks ###
1213
DisableTelemetry # EnableTelemetry
1314
DisableWiFiSense # EnableWiFiSense

src/lib/actions/initial-setup.bat

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ exit /b
5050
call %cliCmd% processing "Downloading Win10-Initial-Setup-Script version %initialSetupVersion%"
5151
call %cliCmd% safeMkdir "^!initialSetupPath^!"
5252

53-
call %cliCmd% processing "^!initialSetupUrl^!"
54-
call %cliCmd% processing "^!initialSetupDownloadPath^!"
55-
5653
call %cliCmd% execPowershellCmd "(New-Object System.Net.WebClient).DownloadFile('^!initialSetupUrl^!', '^!initialSetupDownloadPath^!')"
5754
call %cliCmd% success "Download of Win10-Initial-Setup-Script is done"
5855

0 commit comments

Comments
 (0)