-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* customized CMakeLists.txt to use the Qt installed in C:\Qt * added deploy.bat to build the installer and the zip file * added get_qt_path.ps1 to get the path to the Qt installation
- Loading branch information
Showing
6 changed files
with
107 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,4 +68,5 @@ CMakeLists.txt | |
*.pro.user | ||
*.pro.user* | ||
*.autosave | ||
cmake-build* | ||
qt_path.ini | ||
cmake-build* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
bin/*.exe | ||
bin/*.zip | ||
bin/*.sha256 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
@echo off | ||
setlocal enabledelayedexpansion | ||
|
||
echo Starting Conceal Desktop Windows Deployment | ||
|
||
REM Get Qt path from CMakeLists.txt using PowerShell script | ||
powershell -ExecutionPolicy Bypass -File get_qt_path.ps1 > qt_path.ini | ||
if %ERRORLEVEL% NEQ 0 ( | ||
echo Failed to get Qt path, using default | ||
set "QTDIR=C:\Qt\5.15.2\msvc2019_64" | ||
) else ( | ||
for /f "tokens=2 delims==" %%a in ('type qt_path.ini ^| find "QtDir"') do set "QTDIR=%%a" | ||
) | ||
|
||
echo Using Qt from: %QTDIR% | ||
|
||
REM Run windeployqt | ||
echo Running windeployqt... | ||
"%QTDIR%\bin\windeployqt.exe" --release --no-compiler-runtime "..\..\build\Release\conceal-desktop.exe" | ||
if %ERRORLEVEL% NEQ 0 ( | ||
echo Failed to run windeployqt | ||
exit /b 1 | ||
) | ||
|
||
REM Copy OpenSSL DLLs | ||
echo Copying OpenSSL DLLs... | ||
REM OpenSSL v3 | ||
copy "%QTDIR%\..\..\Tools\OpenSSLv3\Win_x64\bin\libcrypto-3-x64.dll" "..\..\build\Release\" | ||
copy "%QTDIR%\..\..\Tools\OpenSSLv3\Win_x64\bin\libssl-3-x64.dll" "..\..\build\Release\" | ||
REM OpenSSL v1.1 | ||
copy "%QTDIR%\..\..\Tools\mingw1120_64\opt\bin\libcrypto-1_1-x64.dll" "..\..\build\Release\" | ||
copy "%QTDIR%\..\..\Tools\mingw1120_64\opt\bin\libssl-1_1-x64.dll" "..\..\build\Release\" | ||
if %ERRORLEVEL% NEQ 0 ( | ||
echo Error: Failed to copy OpenSSL DLLs | ||
exit /b 1 | ||
) | ||
|
||
REM Run Inno Setup Compiler | ||
echo Creating installer... | ||
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DQtPath="%QTDIR%" ConcealInstaller.iss | ||
if %ERRORLEVEL% NEQ 0 ( | ||
echo Failed to create installer | ||
exit /b 1 | ||
) | ||
|
||
REM Rename the installer to remove spaces | ||
cd bin | ||
set "finalname=" | ||
for %%f in ("Conceal Desktop-*.exe") do ( | ||
set "oldname=%%f" | ||
set "newname=!oldname: =!" | ||
) | ||
|
||
for %%f in ("Conceal*Desktop-*.exe") do ( | ||
set "name=%%f" | ||
set "finalname=!name:.exe=!" | ||
echo Debug: finalname value is: !finalname! | ||
|
||
REM Wait for 3 seconds to ensure the file is released | ||
timeout /t 3 /nobreak | ||
echo Creating ZIP archive... | ||
powershell -Command "Compress-Archive -Path '.\!finalname!.exe' -DestinationPath '.\!finalname!.zip' -Force" | ||
) | ||
|
||
if %ERRORLEVEL% NEQ 0 ( | ||
echo Failed to create ZIP archive | ||
exit /b 1 | ||
) | ||
echo Created ZIP archive: !finalname!.zip | ||
|
||
REM Generate SHA256 hash for the zip file | ||
certutil -hashfile "!finalname!.zip" SHA256 | findstr /v "hash" | findstr /v "CertUtil" > "!finalname!.zip.sha256" | ||
if %ERRORLEVEL% NEQ 0 ( | ||
echo Failed to generate SHA256 for zip | ||
exit /b 1 | ||
) | ||
echo Generated SHA256 hash file: !finalname!.zip.sha256 | ||
|
||
echo Deployment completed successfully | ||
echo Installer, ZIP archive and SHA256 hash can be found in the bin directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Read CMakeLists.txt | ||
$content = Get-Content "../../CMakeLists.txt" -Raw | ||
|
||
# Extract Qt path using regex | ||
$pattern = 'set\(CMAKE_PREFIX_PATH\s+"([^"]+)"' | ||
if ($content -match $pattern) { | ||
$qtPath = $matches[1] | ||
# Convert to proper path format and remove \lib\cmake\ | ||
$qtPath = $qtPath -replace '\\\\', '\' -replace '\\lib\\cmake\\$', '' | ||
|
||
# Output in INI format | ||
Write-Output "[Path]`nQtDir=$qtPath" | ||
} else { | ||
Write-Error "Qt path not found in CMakeLists.txt" | ||
exit 1 | ||
} |