Updated NSIS script.

Merged 078842b084 and 9fb5cfbd63.
This commit is contained in:
raspopov 2024-08-23 17:59:58 +03:00
commit f513a06001
No known key found for this signature in database
GPG Key ID: 2B35203E97E80E13
3 changed files with 34 additions and 14 deletions

View File

@ -103,19 +103,39 @@ if( WIN32 )
"service_restart.bat" "Service restart" "service_restart.bat" "Service restart"
) )
file( WRITE "${CMAKE_BINARY_DIR}/ver.nsi" "VIProductVersion ${MAIN_VERSION}.0\n" ) # Attributes section (installer version info)
file( APPEND "${CMAKE_BINARY_DIR}/ver.nsi" "VIFileVersion ${PROJECT_VERSION}\n" ) string( REPLACE ";" "" CPACK_NSIS_DEFINES
file( APPEND "${CMAKE_BINARY_DIR}/ver.nsi" "VIAddVersionKey /LANG=0 \"ProductVersion\" \"${MAIN_VERSION}.0\"\n" ) "VIProductVersion ${PROJECT_VERSION}\n"
file( APPEND "${CMAKE_BINARY_DIR}/ver.nsi" "VIAddVersionKey /LANG=0 \"FileVersion\" \"${PROJECT_VERSION}\"\n" ) "VIFileVersion ${PROJECT_VERSION}\n"
file( APPEND "${CMAKE_BINARY_DIR}/ver.nsi" "VIAddVersionKey /LANG=0 \"ProductName\" \"${PROJECT_NAME}\"\n" ) "VIAddVersionKey /LANG=0 \"ProductVersion\" \"${PROJECT_VERSION}\"\n"
file( APPEND "${CMAKE_BINARY_DIR}/ver.nsi" "VIAddVersionKey /LANG=0 \"FileDescription\" \"${PROJECT_DESCRIPTION}\"\n" ) "VIAddVersionKey /LANG=0 \"FileVersion\" \"${PROJECT_VERSION}\"\n"
file( APPEND "${CMAKE_BINARY_DIR}/ver.nsi" "VIAddVersionKey /LANG=0 \"CompanyName\" \"${PROJECT_VENDOR}\"\n" ) "VIAddVersionKey /LANG=0 \"ProductName\" \"${CPACK_PACKAGE_DESCRIPTION}\"\n"
file( APPEND "${CMAKE_BINARY_DIR}/ver.nsi" "VIAddVersionKey /LANG=0 \"LegalCopyright\" \"${PROJECT_COPYRIGHT}\"\n" ) "VIAddVersionKey /LANG=0 \"FileDescription\" \"${CPACK_PACKAGE_DESCRIPTION}\"\n"
set( CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS "V0 ${CMAKE_BINARY_DIR}/ver.nsi" ) "VIAddVersionKey /LANG=0 \"CompanyName\" \"${PROJECT_VENDOR}\"\n"
"VIAddVersionKey /LANG=0 \"LegalCopyright\" \"${PROJECT_COPYRIGHT}\""
)
# Preinstall section
string( REPLACE ";" "" CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS
" ExecWait \"sc stop ${PROJECT_NAME}\""
)
# Install section
string( REPLACE ";" "" CPACK_NSIS_EXTRA_INSTALL_COMMANDS
"Push \"InstallLocation\"\n"
"Push \"$INSTDIR\\\"\n"
"Call ConditionalAddToRegistry\n"
"Push \"Comments\"\n"
"Push \"${CPACK_PACKAGE_DESCRIPTION}\"\n"
"Call ConditionalAddToRegistry\n"
"ExecWait \"$INSTDIR\\service_install.bat\""
)
# Uninstall section
string( REPLACE ";" "" CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
"ExecWait \"$INSTDIR\\service_delete.bat\""
)
set( CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS "ExecWait \"sc stop ${PROJECT_NAME}\"" )
set( CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait \"$INSTDIR\\service_install.bat\"" )
set( CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "ExecWait \"$INSTDIR\\service_delete.bat\"" )
set( CPACK_NSIS_CONTACT "${PROJECT_VENDOR}" ) set( CPACK_NSIS_CONTACT "${PROJECT_VENDOR}" )
set( CPACK_NSIS_HELP_LINK "${PROJECT_HOMEPAGE_URL}" ) set( CPACK_NSIS_HELP_LINK "${PROJECT_HOMEPAGE_URL}" )
set( CPACK_NSIS_URL_INFO_ABOUT "${PROJECT_HOMEPAGE_URL}" ) set( CPACK_NSIS_URL_INFO_ABOUT "${PROJECT_HOMEPAGE_URL}" )

View File

@ -1,4 +1,4 @@
@echo off @echo off
title ByeDPI title ByeDPI
"%~dp0ciadpi.exe" --ip 127.0.0.1 --oob 3+s --split 1+s --disorder 3+s --mod-http=h,d --tlsrec 1+s "%~dp0ciadpi.exe" --ip 127.0.0.1 --oob 3+s --split 1 --disorder 3+s --mod-http=h,d --auto=torst --tlsrec 1+s

View File

@ -11,7 +11,7 @@ exit /b 0
set svc_name="ByeDPI" set svc_name="ByeDPI"
set svc_desc="Local SOCKS proxy server to bypass DPI (Deep Packet Inspection)." set svc_desc="Local SOCKS proxy server to bypass DPI (Deep Packet Inspection)."
set svc_bin="\"%~dp0ciadpi.exe\" --ip 127.0.0.1 --oob 3+s --split 1+s --disorder 3+s --mod-http=h,d --tlsrec 1+s" set svc_bin="\"%~dp0ciadpi.exe\" --ip 127.0.0.1 --oob 3+s --split 1 --disorder 3+s --mod-http=h,d --auto=torst --tlsrec 1+s"
sc stop %svc_name% sc stop %svc_name%
sc delete %svc_name% sc delete %svc_name%