Skip to content

Commit 57fc5de

Browse files
committed
Initial Commit
0 parents  commit 57fc5de

26 files changed

+1495
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
bin/php-ch.exe
3+
php-ch.exe

LICENSE

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Copyright 2022 Aditya Giri
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8+

bin/elevate.cmd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@setlocal
2+
@echo off
3+
4+
:: Try without elevation, in case %NVM_SYMLINK% is a user-owned path and the
5+
:: machine has Windows 10 Developer Mode enabled
6+
%*
7+
if %ERRORLEVEL% LSS 1 goto :EOF
8+
9+
:: The command failed without elevation, try with elevation
10+
set CMD=%*
11+
set APP=%1
12+
start wscript //nologo "%~dpn0.vbs" %*

bin/elevate.vbs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Set Shell = CreateObject("Shell.Application")
2+
Set WShell = WScript.CreateObject("WScript.Shell")
3+
Set ProcEnv = WShell.Environment("PROCESS")
4+
5+
cmd = ProcEnv("CMD")
6+
app = ProcEnv("APP")
7+
args= Right(cmd,(Len(cmd)-Len(app)))
8+
9+
If (WScript.Arguments.Count >= 1) Then
10+
Shell.ShellExecute app, args, "", "runas", 0
11+
Else
12+
WScript.Quit
13+
End If

bin/php.ico

21.1 KB
Binary file not shown.

build.bat

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
@echo off
2+
SET INNOSETUP=%CD%\installer.iss
3+
SET ORIG=%CD%
4+
REM SET GOPATH=%CD%\src
5+
SET GOBIN=%CD%\bin
6+
REM Support for older architectures
7+
SET GOARCH=386
8+
9+
REM Cleanup existing build if it exists
10+
if exist bin\php-ch.exe (
11+
del bin\php-ch.exe
12+
)
13+
14+
REM Make the executable and add to the binary directory
15+
echo ----------------------------
16+
echo Building php-ch.exe
17+
echo ----------------------------
18+
go build -o bin/php-ch.exe
19+
20+
REM Group the file with the helper binaries
21+
move php-ch.exe %GOBIN%
22+
23+
REM Codesign the executable
24+
echo ----------------------------
25+
echo Sign the nvm executable...
26+
echo ----------------------------
27+
buildtools\signtool.exe sign /debug /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a %GOBIN%\php-ch.exe
28+
29+
for /f %%i in ('"%GOBIN%\php-ch.exe" version') do set AppVersion=%%i
30+
echo php-ch.exe v%AppVersion% built.
31+
32+
REM Create the distribution folder
33+
SET DIST=%CD%\dist\%AppVersion%
34+
35+
REM Remove old build files if they exist.
36+
if exist %DIST% (
37+
echo ----------------------------
38+
echo Clearing old build in %DIST%
39+
echo ----------------------------
40+
rd /s /q "%DIST%"
41+
)
42+
43+
REM Create the distribution directory
44+
mkdir "%DIST%"
45+
46+
REM Generate the installer (InnoSetup)
47+
echo ----------------------------
48+
echo Generating installer...
49+
echo ----------------------------
50+
buildtools\iscc "%INNOSETUP%" "/o%DIST%"
51+
52+
echo ----------------------------
53+
echo Sign the installer
54+
echo ----------------------------
55+
buildtools\signtool.exe sign /debug /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a %DIST%\php-ch-setup.exe
56+
57+
REM Generate checksums
58+
echo ----------------------------
59+
echo Generating checksums...
60+
echo ----------------------------
61+
for %%f in (%DIST%\*.*) do (certutil -hashfile "%%f" MD5 | find /i /v "md5" | find /i /v "certutil" >> "%%f.checksum.txt")
62+
echo complete
63+
64+
echo ----------------------------
65+
echo Cleaning up...
66+
echo ----------------------------
67+
del %GOBIN%\php-ch.exe
68+
echo complete
69+
@REM del %GOBIN%\php-ch-setup.exe
70+
71+
echo php-ch v%AppVersion% build completed. Available in %DIST%
72+
@echo on

0 commit comments

Comments
 (0)