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

VM-Install-Shortcut uses unnecessary amount of characters for "executableArgs" #841

Open
emtuls opened this issue Jan 17, 2024 · 3 comments
Assignees
Labels
💎 enhancement It is working, but it could be better ❔ discussion Further discussion is needed

Comments

@emtuls
Copy link
Member

emtuls commented Jan 17, 2024

What's the problem?

The function VM-Install-Shortcut creates an argument $executableArgs with a long list of arguments that can each be long themselves, leading to the possibility of hitting the character limit when creating a shortcut (which is a quiet error that doesn't display).

I propose we remove the && echo $executableDir^> $executablePath $arguments piece as this doesn't serve much functionality and it extends the command that is put inside the shortcut by almost double.

Steps to Reproduce

Attempt to create a shortcut whose $executablePath + $arguments may be long, for example:

$executablePath = "%ProgramFiles%\Google\Chrome\Application\chrome.exe"
$arguments = "C:\Tools\cyberchef\CyberChef_v10.5.2.html & exit"

This gets cut off around C:\Tools\cyb which is incomplete for me to perform the action I'm intending to do to fix another issue.

Environment

Environment Independent

Additional Information

No response

Detected by test suite

No

@emtuls emtuls added the 🐛 bug Something isn't working label Jan 17, 2024
@emtuls emtuls added ❔ discussion Further discussion is needed 💎 enhancement It is working, but it could be better labels Jan 17, 2024
@Ana06
Copy link
Member

Ana06 commented Jan 17, 2024

I think the echo is useful to know what has been run for console applications. From #676 (issue for discussion on how to unify and improve shortcuts):

It's useful to display what commands get executed when a LNK is clicked

I think it would be good idea in the shortcut helper to either:

  • fail the installation if we exceed the limit
  • render a warning remove the echo in this case (I prefer this option)

But CyberChef is not a console application, so it should not be run as a console application and the echo is not used in that case. Or am I missing something @emtuls ? 🤔

@Ana06 Ana06 removed the 🐛 bug Something isn't working label Jan 17, 2024
@emtuls
Copy link
Member Author

emtuls commented Jan 17, 2024

Cyberchef is not normally a console application, but due to how I would like to have chrome open the local cyberchef .html page (programmatically modifying Chrome config files is fairly inconsistent and will likely break), it would work best if I utilized a command prompt shortcut, which is essentially what our consoleapp flag creates for VM-Install-Shortcut.

One other alternative that may resolve the current issue with cyberchef specifically, if we don't take either of your suggested routes, would be fixing #842, as I believe that should reduce the length of the command as well.

I do think it may be worth considering your second option though if we want to be safe for future occurrences of this issue.

@Ana06 Ana06 removed their assignment Apr 11, 2024
@Ana06
Copy link
Member

Ana06 commented Jun 7, 2024

@emtuls what is the state of this issue? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💎 enhancement It is working, but it could be better ❔ discussion Further discussion is needed
Projects
None yet
Development

No branches or pull requests

2 participants