Skip to content
forked from hufrea/byedpi

Commit

Permalink
Updated NSIS script.
Browse files Browse the repository at this point in the history
Merged 078842b and 9fb5cfb.
  • Loading branch information
raspopov committed Aug 23, 2024
2 parents 5cc3939 + 9fb5cfb commit f513a06
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 15 deletions.
46 changes: 33 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,39 @@ if( WIN32 )
"service_restart.bat" "Service restart"
)

file( WRITE "${CMAKE_BINARY_DIR}/ver.nsi" "VIProductVersion ${MAIN_VERSION}.0\n" )
file( APPEND "${CMAKE_BINARY_DIR}/ver.nsi" "VIFileVersion ${PROJECT_VERSION}\n" )
file( APPEND "${CMAKE_BINARY_DIR}/ver.nsi" "VIAddVersionKey /LANG=0 \"ProductVersion\" \"${MAIN_VERSION}.0\"\n" )
file( APPEND "${CMAKE_BINARY_DIR}/ver.nsi" "VIAddVersionKey /LANG=0 \"FileVersion\" \"${PROJECT_VERSION}\"\n" )
file( APPEND "${CMAKE_BINARY_DIR}/ver.nsi" "VIAddVersionKey /LANG=0 \"ProductName\" \"${PROJECT_NAME}\"\n" )
file( APPEND "${CMAKE_BINARY_DIR}/ver.nsi" "VIAddVersionKey /LANG=0 \"FileDescription\" \"${PROJECT_DESCRIPTION}\"\n" )
file( APPEND "${CMAKE_BINARY_DIR}/ver.nsi" "VIAddVersionKey /LANG=0 \"CompanyName\" \"${PROJECT_VENDOR}\"\n" )
file( APPEND "${CMAKE_BINARY_DIR}/ver.nsi" "VIAddVersionKey /LANG=0 \"LegalCopyright\" \"${PROJECT_COPYRIGHT}\"\n" )
set( CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS "V0 ${CMAKE_BINARY_DIR}/ver.nsi" )

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\"" )
# Attributes section (installer version info)
string( REPLACE ";" "" CPACK_NSIS_DEFINES
"VIProductVersion ${PROJECT_VERSION}\n"
"VIFileVersion ${PROJECT_VERSION}\n"
"VIAddVersionKey /LANG=0 \"ProductVersion\" \"${PROJECT_VERSION}\"\n"
"VIAddVersionKey /LANG=0 \"FileVersion\" \"${PROJECT_VERSION}\"\n"
"VIAddVersionKey /LANG=0 \"ProductName\" \"${CPACK_PACKAGE_DESCRIPTION}\"\n"
"VIAddVersionKey /LANG=0 \"FileDescription\" \"${CPACK_PACKAGE_DESCRIPTION}\"\n"
"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_CONTACT "${PROJECT_VENDOR}" )
set( CPACK_NSIS_HELP_LINK "${PROJECT_HOMEPAGE_URL}" )
set( CPACK_NSIS_URL_INFO_ABOUT "${PROJECT_HOMEPAGE_URL}" )
Expand Down
2 changes: 1 addition & 1 deletion dist/windows/byedpi.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@echo off
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
2 changes: 1 addition & 1 deletion dist/windows/service_install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exit /b 0
set svc_name="ByeDPI"
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 delete %svc_name%
Expand Down

0 comments on commit f513a06

Please sign in to comment.