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

[Windows] Parenthesis in packaged filename causes "not recognized as ... command" error #60

Open
mitchhentges opened this issue Apr 2, 2022 · 0 comments

Comments

@mitchhentges
Copy link

mitchhentges commented Apr 2, 2022

When downloading a file that already exists, browsers generally name the second version of the file something like "$file(1).exe". This causes warp-runner to fail to run.

To reproduce

  1. Create a app folder
  2. Create a launch.cmd script inside that folder with the only contents being echo "app ran!"
  3. warp-packer --arch windows-x64 --input_dir app --exec launch.cmd --output "app(1).exe"
  4. "app(1).exe"
'C:\Users\Mitch\AppData\Local\warp\packages\app' is not recognized as an internal or external command,
operable program or batch file.
  1. SET WARP_TRACE=1
  2. "app(1).exe"
2022-04-01 20:43:55,615 TRACE [warp_runner] self_path="C:\\dev\\warp\\app(1).exe"
2022-04-01 20:43:55,615 TRACE [warp_runner] self_file_name="app(1).exe"
2022-04-01 20:43:55,616 TRACE [warp_runner] cache_path="C:\\Users\\Mitch\\AppData\\Local\\warp\\packages\\app(1).exe"
2022-04-01 20:43:55,616 TRACE [warp_runner] target_exec="launch.cmd"
2022-04-01 20:43:55,617 TRACE [warp_runner] target_path="C:\\Users\\Mitch\\AppData\\Local\\warp\\packages\\app(1).exe\\launch.cmd"
2022-04-01 20:43:55,617 TRACE [warp_runner] cache is up-to-date
2022-04-01 20:43:55,618 TRACE [warp_runner::executor] target="C:\\Users\\Mitch\\AppData\\Local\\warp\\packages\\app(1).exe\\launch.cmd"
2022-04-01 20:43:55,618 TRACE [warp_runner::executor] args=[]
'C:\Users\Mitch\AppData\Local\warp\packages\app' is not recognized as an internal or external command,
operable program or batch file.

Cause

cmd /c %path% (as used here) doesn't play nice with special characters.

Workaround

In my case, I only have a launch.cmd so that I could set an environment variable before my app ran.
However, I was able to move that env-var-setting to the very beginning of my executable, at which point I was able to bypass running cmd /c.

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

No branches or pull requests

1 participant