diff --git a/.gitignore b/.gitignore index 94b4d33e..03e21061 100644 --- a/.gitignore +++ b/.gitignore @@ -68,4 +68,5 @@ CMakeLists.txt *.pro.user *.pro.user* *.autosave -cmake-build* \ No newline at end of file +qt_path.ini +cmake-build* diff --git a/CMakeLists.txt b/CMakeLists.txt index 3aee3419..57577f02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE GIT_REVISION) set(CRYPTONOTE_LIB cryptonote) -set(CMAKE_PREFIX_PATH "C:\\Qt-ack2\\5.15.2\\msvc2019_64\\lib\\cmake\\") +set(CMAKE_PREFIX_PATH "C:\\Qt\\5.15.2\\msvc2019_64\\lib\\cmake\\") include_directories(${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/installer/windows/.gitignore b/installer/windows/.gitignore index 2d82bfcc..a5173406 100644 --- a/installer/windows/.gitignore +++ b/installer/windows/.gitignore @@ -1 +1,3 @@ bin/*.exe +bin/*.zip +bin/*.sha256 diff --git a/installer/windows/README.md b/installer/windows/README.md index 36b3f06e..525978ce 100644 --- a/installer/windows/README.md +++ b/installer/windows/README.md @@ -17,5 +17,11 @@ Then follow these steps: - Start Inno Setup, load `ConcealInstaller.iss` and compile it. - When the compilation is finished, the installer will be in the `bin` directory. +### or use the deploy.bat script +from within installer/windows , run: +``` +deploy.bat +``` + ## Credits Special thanks to DomGries who created [InnoDependencyInstaller](https://github.com/DomGries/InnoDependencyInstaller) which is the base of the Conceal Desktop installer. \ No newline at end of file diff --git a/installer/windows/deploy.bat b/installer/windows/deploy.bat new file mode 100644 index 00000000..37b0ecff --- /dev/null +++ b/installer/windows/deploy.bat @@ -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 \ No newline at end of file diff --git a/installer/windows/get_qt_path.ps1 b/installer/windows/get_qt_path.ps1 new file mode 100644 index 00000000..3276d6d0 --- /dev/null +++ b/installer/windows/get_qt_path.ps1 @@ -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 +} \ No newline at end of file