Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: have a way to override install directory #171

Closed
chrisant996 opened this issue Sep 23, 2021 · 6 comments
Closed

Request: have a way to override install directory #171

chrisant996 opened this issue Sep 23, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@chrisant996
Copy link
Owner

Copied to separate issue from original post by @u01jmg3 in #169

It would be helpful to configure the directory clink installs into via the installer.

e.g. C:\Program Files (x86)\clink rather than C:\Program Files (x86)\clink\1.2.34.6cb41a

Reason being I have a custom setting for Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor\Autorun and every time a new update for clink is released I have to update this setting with the new version number and commit hash of clink. Just a minor annoyance.

@chrisant996 chrisant996 added the enhancement New feature or request label Sep 23, 2021
@chrisant996
Copy link
Owner Author

Martin has comments in the installer code that specifically state the versioned directory solves some interference problem, but there aren't any more details about it.

So I know making that change will break something(s). But I don't know what. That makes me not want to change it at this time.

You could write a script to get the version number from the directory name, and automatically set the AutoRun regkey to include the version number.

@u01jmg3
Copy link

u01jmg3 commented Sep 24, 2021

A separate way of tackling this issue (and the reason I asked to have the functionality above) would be to maintain the order of existing autorun commands and to keep any flags that are set against clink.

e.g. this is what I want my autorun command to look like:

"C:\Portable Apps\AutoHotkey\Includes\Cmd.ahk" & "C:\Program Files (x86)\clink\1.2.35.fa2a3e\clink.bat" inject --autorun --quiet --profile ~\clink & "%USERPROFILE%\Documents\alias.cmd"

However, when installing clink this is what it becomes:

"C:\Portable Apps\AutoHotkey\Includes\Cmd.ahk" & "%USERPROFILE%\Documents\alias.cmd"&"C:\Program Files (x86)\clink\1.2.35.fa2a3e\clink.bat" inject --autorun --profile ~\clink

Note: the order is different and the --quiet flag is not kept.

@chrisant996
Copy link
Owner Author

Why do you need Clink to not be last?

You're right that it's possible to make clink autorun install preserve the order and preserve arguments. But the order is intentionally changed: Clink is always put last to help it overcome compatibility programs with other software that also hooks cmd. The later in the start order, the better.

There are situations where changing the order and restoring default arguments is how to solve a problem. I've also seen many trouble posts about "Clink stopped working, so I reinstalled and then it was fine". We'll never know exactly why reinstalling solved whatever problem was occurring, but yesterday I debugged some rather nasty interference from AnsiCon and it made it very clear that the order in AutoRun can make a big difference.

A separate way of tackling this issue would be to use clink set clink.logo none to make Clink never show the startup logo.

Another way would be to write a script, and put the script in the AutoRun regkey in the order where you want it. Make the script find the version directory and inject with --quiet or etc. The Clink installer won't remove the script from the AutoRun regkey, and the explicit clink inject that gets added by the installer will have no effect (unless it specifies a different --profile location than your script does).

There are several easy and convenient ways you can solve this problem without any changes in Clink, and making the proposed changes in Clink definitely would have negative side effects in some cases. I recommend solving the problem without further changes in Clink.

@u01jmg3
Copy link

u01jmg3 commented Sep 24, 2021

Appreciate your time to review this. Indeed this is not a problem to be solved by changing Clink. I shall do as advised. Thank you.

@u01jmg3
Copy link

u01jmg3 commented Nov 12, 2021

@chrisant996: something doesn't look to be correct with the new "Use versioned install directory" setting introduced in v1.2.44. I have this ticked (the default) yet it installs to a bin/ dir. Equally, I have "Add shortcuts to Start menu" unticked yet it creates them.

screenshot

@chrisant996
Copy link
Owner Author

chrisant996 commented Nov 12, 2021

@chrisant996: something doesn't look to be correct with the new "Use versioned install directory" setting introduced in v1.2.44. I have this ticked (the default) yet it installs to a bin/ dir. Equally, I have "Add shortcuts to Start menu" unticked yet it creates them.

Well that's disappointing. I tested all of them, many times. I can reproduce the behavior in the released installed, and I'll track down what's going on.

I opened a separate issue for tracking purposes.

UPDATE: Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants
-