diff --git a/Makefile b/Makefile index 95738b5e..4ece7411 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ GEO_ASSETS_DIR=assets$(SEP)core CORE_PRODUCT_NAME=hiddify-core CORE_NAME=$(CORE_PRODUCT_NAME) LIB_NAME=libcore -SRV_NAME=HiddifyService + ifeq ($(CHANNEL),prod) CORE_URL=https://github.com/hiddify/hiddify-next-core/releases/download/v$(core.version) else @@ -146,7 +146,7 @@ windows-libs: $(MKDIR) $(DESKTOP_OUT) || echo Folder already exists. Skipping... curl -L $(CORE_URL)/$(CORE_NAME)-windows-amd64.tar.gz | tar xz -C $(DESKTOP_OUT)$(SEP) ls $(DESKTOP_OUT) || dir $(DESKTOP_OUT)$(SEP) - #$(RM) $(DESKTOP_OUT)$(SEP)HiddifyService.exe + #$(RM) $(DESKTOP_OUT)$(SEP)HiddifyCli.exe #temporary disable windows service linux-libs: diff --git a/libcore b/libcore index f9e6f022..8ecd0d96 160000 --- a/libcore +++ b/libcore @@ -1 +1 @@ -Subproject commit f9e6f022c89604c2dac87d0ddd0831f8337fcdc3 +Subproject commit 8ecd0d9644a5bdf57d38cde36744902502fec59d diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 8abb9b5b..7bb10dfb 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -112,7 +112,7 @@ install(FILES "../libcore/bin/libcore.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR} COMPONENT Runtime) install( - FILES "../libcore/bin/HiddifyService" + FILES "../libcore/bin/HiddifyCli" DESTINATION "${CMAKE_INSTALL_PREFIX}" PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ COMPONENT Runtime diff --git a/linux/packaging/appimage/AppRun b/linux/packaging/appimage/AppRun index 8cd12fa2..1df795b1 100644 --- a/linux/packaging/appimage/AppRun +++ b/linux/packaging/appimage/AppRun @@ -6,10 +6,8 @@ export LD_LIBRARY_PATH=usr/lib # Usage info show_help() { cat << EOF -Usage: ${0##*/} [-s | -v | -h ] ... -start Hiddify or HiddifyService, when no parameter is given, Hiddify is executed. - -h display this help and exit - -s start|stop start/stop HiddifyService. +Usage: ${0##*/} ... +start Hiddify or HiddifyCli, when no parameter is given, Hiddify is executed. -v show version EOF } @@ -25,11 +23,17 @@ OPTIND=1 # It is a good idea to make OPTIND local if you process options in a function. # if no arg is provided, execute hiddify app -[[ $# == 0 ]] && exec ./hiddify +if [[ $# == 0 ]];then + exec ./hiddify +else # processing arguments -while getopts s:vh opt; do - case $opt in + + case $1 in + HiddifyCli) + exec ./HiddifyCli ${@:3} + exit 0 + ;; h) show_help exit 0 @@ -37,21 +41,12 @@ while getopts s:vh opt; do v) show_version exit 0 ;; - s) action="$OPTARG" - ((service++)) - ;; *) show_help >&2 exit 1 ;; esac -done -shift "$((OPTIND-1))" # Discard the options and sentinel -- -# argument -s is given, do HiddfyService -if [[ "$service" == 1 ]]; then - if [[ "$action" =~ start|stop ]]; then - exec ./HiddifyService "$action" - fi + + fi - diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index f2e97534..184e6eb6 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -87,8 +87,8 @@ install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" install(FILES "../libcore/bin/libcore.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime RENAME libcore.dll) -install(FILES "../libcore/bin/HiddifyService.exe" DESTINATION "${CMAKE_INSTALL_PREFIX}" -COMPONENT Runtime RENAME HiddifyService.exe) +install(FILES "../libcore/bin/HiddifyCli.exe" DESTINATION "${CMAKE_INSTALL_PREFIX}" +COMPONENT Runtime RENAME HiddifyCli.exe) if(PLUGIN_BUNDLED_LIBRARIES) diff --git a/windows/packaging/exe/inno_setup.sas b/windows/packaging/exe/inno_setup.sas new file mode 100644 index 00000000..1017c728 --- /dev/null +++ b/windows/packaging/exe/inno_setup.sas @@ -0,0 +1,75 @@ +[Setup] +AppId={{APP_ID}} +AppVersion={{APP_VERSION}} +AppName={{DISPLAY_NAME}} +AppPublisher={{PUBLISHER_NAME}} +AppPublisherURL={{PUBLISHER_URL}} +AppSupportURL={{PUBLISHER_URL}} +AppUpdatesURL={{PUBLISHER_URL}} +DefaultDirName={{INSTALL_DIR_NAME}} +DisableProgramGroupPage=yes +OutputDir=. +OutputBaseFilename={{OUTPUT_BASE_FILENAME}} +Compression=lzma +SolidCompression=yes +SetupIconFile={{SETUP_ICON_FILE}} +WizardStyle=modern +PrivilegesRequired={{PRIVILEGES_REQUIRED}} +ArchitecturesAllowed=x64 +ArchitecturesInstallIn64BitMode=x64 +CloseApplications=force + +[Languages] +{% for locale in LOCALES %} +{% if locale == 'en' %}Name: "english"; MessagesFile: "compiler:Default.isl"{% endif %} +{% if locale == 'hy' %}Name: "armenian"; MessagesFile: "compiler:Languages\\Armenian.isl"{% endif %} +{% if locale == 'bg' %}Name: "bulgarian"; MessagesFile: "compiler:Languages\\Bulgarian.isl"{% endif %} +{% if locale == 'ca' %}Name: "catalan"; MessagesFile: "compiler:Languages\\Catalan.isl"{% endif %} +{% if locale == 'zh' %}Name: "chinesesimplified"; MessagesFile: "compiler:Languages\\ChineseSimplified.isl"{% endif %} +{% if locale == 'co' %}Name: "corsican"; MessagesFile: "compiler:Languages\\Corsican.isl"{% endif %} +{% if locale == 'cs' %}Name: "czech"; MessagesFile: "compiler:Languages\\Czech.isl"{% endif %} +{% if locale == 'da' %}Name: "danish"; MessagesFile: "compiler:Languages\\Danish.isl"{% endif %} +{% if locale == 'nl' %}Name: "dutch"; MessagesFile: "compiler:Languages\\Dutch.isl"{% endif %} +{% if locale == 'fi' %}Name: "finnish"; MessagesFile: "compiler:Languages\\Finnish.isl"{% endif %} +{% if locale == 'fr' %}Name: "french"; MessagesFile: "compiler:Languages\\French.isl"{% endif %} +{% if locale == 'de' %}Name: "german"; MessagesFile: "compiler:Languages\\German.isl"{% endif %} +{% if locale == 'he' %}Name: "hebrew"; MessagesFile: "compiler:Languages\\Hebrew.isl"{% endif %} +{% if locale == 'is' %}Name: "icelandic"; MessagesFile: "compiler:Languages\\Icelandic.isl"{% endif %} +{% if locale == 'it' %}Name: "italian"; MessagesFile: "compiler:Languages\\Italian.isl"{% endif %} +{% if locale == 'ja' %}Name: "japanese"; MessagesFile: "compiler:Languages\\Japanese.isl"{% endif %} +{% if locale == 'no' %}Name: "norwegian"; MessagesFile: "compiler:Languages\\Norwegian.isl"{% endif %} +{% if locale == 'pl' %}Name: "polish"; MessagesFile: "compiler:Languages\\Polish.isl"{% endif %} +{% if locale == 'pt' %}Name: "portuguese"; MessagesFile: "compiler:Languages\\Portuguese.isl"{% endif %} +{% if locale == 'ru' %}Name: "russian"; MessagesFile: "compiler:Languages\\Russian.isl"{% endif %} +{% if locale == 'sk' %}Name: "slovak"; MessagesFile: "compiler:Languages\\Slovak.isl"{% endif %} +{% if locale == 'sl' %}Name: "slovenian"; MessagesFile: "compiler:Languages\\Slovenian.isl"{% endif %} +{% if locale == 'es' %}Name: "spanish"; MessagesFile: "compiler:Languages\\Spanish.isl"{% endif %} +{% if locale == 'tr' %}Name: "turkish"; MessagesFile: "compiler:Languages\\Turkish.isl"{% endif %} +{% if locale == 'uk' %}Name: "ukrainian"; MessagesFile: "compiler:Languages\\Ukrainian.isl"{% endif %} +{% endfor %} + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: {% if CREATE_DESKTOP_ICON != true %}unchecked{% else %}checkedonce{% endif %} +Name: "launchAtStartup"; Description: "{cm:AutoStartProgram,{{DISPLAY_NAME}}}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: {% if LAUNCH_AT_STARTUP != true %}unchecked{% else %}checkedonce{% endif %} +[Files] +Source: "{{SOURCE_DIR}}\\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{autoprograms}\\{{DISPLAY_NAME}}"; Filename: "{app}\\{{EXECUTABLE_NAME}}" +Name: "{autodesktop}\\{{DISPLAY_NAME}}"; Filename: "{app}\\{{EXECUTABLE_NAME}}"; Tasks: desktopicon +Name: "{userstartup}\\{{DISPLAY_NAME}}"; Filename: "{app}\\{{EXECUTABLE_NAME}}"; WorkingDir: "{app}"; Tasks: launchAtStartup +[Run] +Filename: "{app}\\{{EXECUTABLE_NAME}}"; Description: "{cm:LaunchProgram,{{DISPLAY_NAME}}}"; Flags: {% if PRIVILEGES_REQUIRED == 'admin' %}runascurrentuser{% endif %} nowait postinstall skipifsilent + + +[Code] +function InitializeSetup(): Boolean; +var + ResultCode: Integer; +begin + Exec('taskkill', '/F /IM hiddify.exe', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) + Exec('net', 'stop "HiddifyTunnelService"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) + Exec('sc.exe', 'delete "HiddifyTunnelService"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) + Result := True; +end; \ No newline at end of file diff --git a/windows/packaging/exe/make_config.yaml b/windows/packaging/exe/make_config.yaml index 7f20b076..4f9e2e93 100644 --- a/windows/packaging/exe/make_config.yaml +++ b/windows/packaging/exe/make_config.yaml @@ -13,4 +13,4 @@ locales: - ru - pt - tr -#script_template: inno_setup.sas +script_template: inno_setup.sas