Skip to content

Commit

Permalink
Make BrowserProxy.rc for /f friendly, and add an after_build step to …
Browse files Browse the repository at this point in the history
…appveyor.yml which creates an SFX installer
  • Loading branch information
datadiode committed Sep 20, 2023
1 parent a463f98 commit 2aeeae5
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
Binary file modified BrowserProxy/BrowserProxy.rc
Binary file not shown.
Binary file added Installer/MakeSFX.exe
Binary file not shown.
18 changes: 18 additions & 0 deletions Installer/MakeSetup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@echo off
REM Read the version number from the resource file
for /F "tokens=1,2" %%G in (%~dp0..\BrowserProxy\BrowserProxy.rc) do if "%%G" == "FILEVERSION" set FILEVERSION=%%H
echo FILEVERSION=%FILEVERSION:,=.%
REM Create the ZIP
del "%~dp0OpennessWebView2.zip"
"%ProgramFiles%\7-zip\7z.exe" a -mx9 "%~dp0OpennessWebView2.zip" "%~dp0..\BrowserProxy\Release\*.dll" "%~dp0..\LICENSE.md" "%~dp0setup.bat"
REM Create the SFX
"%~dp0makesfx.exe" ^
/zip="%~dp0OpennessWebView2.zip" ^
/sfx="%~dp0OpennessWebView2.exe" ^
/title="OpennessWebView2 Control" ^
/website="https://github.com/datadiode/webview2" ^
/intro="Version: %FILEVERSION:,=.%\n\nThis ActiveX control embeds Microsoft Edge WebView2\ninto SIMATIC WinCC Runtime Advanced.\n\nThe Microsoft Edge WebView2 Runtime needs to be\ninstalled to use this control." ^
/runelevated ^
/overwrite ^
/exec="\"cmd.exe\" /c setup.bat $cmdline$" ^
/defaultpath="$programfiles$\OpennessWebView2"
8 changes: 8 additions & 0 deletions Installer/setup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@echo off
if /i not "%~x2" == ".cab" goto :register
expand.exe -f:* %2 .
echo [OpennessWebView2.dll] > OpennessWebView2.ini
echo BrowserExecutableFolder=%~dp0%~n2 >> OpennessWebView2.ini
:register
regsvr32.exe OpennessWebView2.dll
del %0
4 changes: 4 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ build:
verbosity: minimal
project: BrowserProxy.sln

after_build:
- Installer\MakeSetup.bat

artifacts:
- path: BrowserProxy\$(configuration)\OpennessWebView2.dll
- path: Installer\OpennessWebView2.exe

0 comments on commit 2aeeae5

Please sign in to comment.