Skip to content

Commit d250611

Browse files
committed
fix: create update and uninstall shortcuts as early as possible
1 parent 7f40644 commit d250611

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

InstallControllerBuddy.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,26 @@ else
687687

688688
create_shortcut ControllerBuddy "$cb_exe_path" '-autostart local -tray' "$cb_dir"
689689

690+
script_path="$cb_bin_dir/$script_name"
691+
692+
if [ ! "$(dirname "${BASH_SOURCE[0]}")" -ef "$cb_bin_dir" ]
693+
then
694+
log "Updating local copy of $script_name..."
695+
cp "${BASH_SOURCE[0]}" "$script_path"
696+
check_retval "Error: Failed to copy $script_name to $script_path"
697+
fi
698+
699+
if [ "$OSTYPE" = msys ]
700+
then
701+
script_command="$script_path"
702+
script_work_dir=%TMP%
703+
else
704+
script_command="/bin/bash $script_path"
705+
script_work_dir=/tmp
706+
fi
707+
create_shortcut 'Update ControllerBuddy' "$script_command" '' "$script_work_dir"
708+
create_shortcut 'Uninstall ControllerBuddy' "$script_command" uninstall "$script_work_dir"
709+
690710
check_cb_installed_version
691711
if [ -z "$cb_installed_version" ]
692712
then
@@ -792,26 +812,6 @@ else
792812
install_dcs_integration "$dcs_open_beta_user_dir"
793813
fi
794814

795-
script_path="$cb_bin_dir/$script_name"
796-
797-
if [ ! "$(dirname "${BASH_SOURCE[0]}")" -ef "$cb_bin_dir" ]
798-
then
799-
log "Updating local copy of $script_name..."
800-
cp "${BASH_SOURCE[0]}" "$script_path"
801-
check_retval "Error: Failed to copy $script_name to $script_path"
802-
fi
803-
804-
if [ "$OSTYPE" = msys ]
805-
then
806-
script_command="$script_path"
807-
script_work_dir=%TMP%
808-
else
809-
script_command="/bin/bash $script_path"
810-
script_work_dir=/tmp
811-
fi
812-
create_shortcut 'Update ControllerBuddy' "$script_command" '' "$script_work_dir"
813-
create_shortcut 'Uninstall ControllerBuddy' "$script_command" uninstall "$script_work_dir"
814-
815815
if [ "$restart" = true ]
816816
then
817817
log 'Launching ControllerBuddy...'

0 commit comments

Comments
 (0)