new: add hiddifycli and resolve all false positve from anti virus, auto exit during installation

This commit is contained in:
Hiddify
2024-03-09 22:16:48 +01:00
parent e856aa8109
commit e2c6ef7a98
7 changed files with 95 additions and 25 deletions

View File

@@ -20,7 +20,7 @@ GEO_ASSETS_DIR=assets$(SEP)core
CORE_PRODUCT_NAME=hiddify-core CORE_PRODUCT_NAME=hiddify-core
CORE_NAME=$(CORE_PRODUCT_NAME) CORE_NAME=$(CORE_PRODUCT_NAME)
LIB_NAME=libcore LIB_NAME=libcore
SRV_NAME=HiddifyService
ifeq ($(CHANNEL),prod) ifeq ($(CHANNEL),prod)
CORE_URL=https://github.com/hiddify/hiddify-next-core/releases/download/v$(core.version) CORE_URL=https://github.com/hiddify/hiddify-next-core/releases/download/v$(core.version)
else else
@@ -146,7 +146,7 @@ windows-libs:
$(MKDIR) $(DESKTOP_OUT) || echo Folder already exists. Skipping... $(MKDIR) $(DESKTOP_OUT) || echo Folder already exists. Skipping...
curl -L $(CORE_URL)/$(CORE_NAME)-windows-amd64.tar.gz | tar xz -C $(DESKTOP_OUT)$(SEP) curl -L $(CORE_URL)/$(CORE_NAME)-windows-amd64.tar.gz | tar xz -C $(DESKTOP_OUT)$(SEP)
ls $(DESKTOP_OUT) || dir $(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 #temporary disable windows service
linux-libs: linux-libs:

Submodule libcore updated: f9e6f022c8...8ecd0d9644

View File

@@ -112,7 +112,7 @@ install(FILES "../libcore/bin/libcore.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}
COMPONENT Runtime) COMPONENT Runtime)
install( install(
FILES "../libcore/bin/HiddifyService" FILES "../libcore/bin/HiddifyCli"
DESTINATION "${CMAKE_INSTALL_PREFIX}" DESTINATION "${CMAKE_INSTALL_PREFIX}"
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
COMPONENT Runtime COMPONENT Runtime

View File

@@ -6,10 +6,8 @@ export LD_LIBRARY_PATH=usr/lib
# Usage info # Usage info
show_help() { show_help() {
cat << EOF cat << EOF
Usage: ${0##*/} [-s | -v | -h ] ... Usage: ${0##*/} ...
start Hiddify or HiddifyService, when no parameter is given, Hiddify is executed. start Hiddify or HiddifyCli, when no parameter is given, Hiddify is executed.
-h display this help and exit
-s start|stop start/stop HiddifyService.
-v show version -v show version
EOF EOF
} }
@@ -25,11 +23,17 @@ OPTIND=1
# It is a good idea to make OPTIND local if you process options in a function. # It is a good idea to make OPTIND local if you process options in a function.
# if no arg is provided, execute hiddify app # if no arg is provided, execute hiddify app
[[ $# == 0 ]] && exec ./hiddify if [[ $# == 0 ]];then
exec ./hiddify
else
# processing arguments # processing arguments
while getopts s:vh opt; do
case $opt in case $1 in
HiddifyCli)
exec ./HiddifyCli ${@:3}
exit 0
;;
h) h)
show_help show_help
exit 0 exit 0
@@ -37,21 +41,12 @@ while getopts s:vh opt; do
v) show_version v) show_version
exit 0 exit 0
;; ;;
s) action="$OPTARG"
((service++))
;;
*) *)
show_help >&2 show_help >&2
exit 1 exit 1
;; ;;
esac 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
fi

View File

@@ -87,8 +87,8 @@ install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
install(FILES "../libcore/bin/libcore.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" install(FILES "../libcore/bin/libcore.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime RENAME libcore.dll) COMPONENT Runtime RENAME libcore.dll)
install(FILES "../libcore/bin/HiddifyService.exe" DESTINATION "${CMAKE_INSTALL_PREFIX}" install(FILES "../libcore/bin/HiddifyCli.exe" DESTINATION "${CMAKE_INSTALL_PREFIX}"
COMPONENT Runtime RENAME HiddifyService.exe) COMPONENT Runtime RENAME HiddifyCli.exe)
if(PLUGIN_BUNDLED_LIBRARIES) if(PLUGIN_BUNDLED_LIBRARIES)

View File

@@ -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;

View File

@@ -13,4 +13,4 @@ locales:
- ru - ru
- pt - pt
- tr - tr
#script_template: inno_setup.sas script_template: inno_setup.sas