[Windows] Parenthesis in packaged filename causes "not recognized as ... command" error
mitchhentges opened this issue · comments
Mitchell Hentges commented
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
- Create a
app
folder - Create a
launch.cmd
script inside that folder with the only contents beingecho "app ran!"
warp-packer --arch windows-x64 --input_dir app --exec launch.cmd --output "app(1).exe"
"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.
SET WARP_TRACE=1
"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
.