Pregunta

We've been using 7zip for a couple of years to zip up our software packages to create a single self-extracting executable. Our default InstallPath is a path without spaces e.g. C:\Install\Downloads and this works fine. However, when the path is changed to a custom location with spaces in the folder name e.g. C:\my temp folder\Downloads then the extraction will still be successful but the executable will not be located and can't be run.

The error message that pops up is Error during execution "C:\my temp folder\Downloads\foo\setup.exe". The system cannot find the file specified. If you open the folder location that it's referring to, the setup.exe file is definitely there. It seems that the spaces in the custom file location is confusing whatever launches the executable that is specified in the RunProgram variable in the config file.

Our config file:

;!@Install@!UTF-8!
Title="FOO PACKAGE NAME"
CancelPrompt="Are you sure you want to cancel?"
FinishMessage="Files were successfully extracted"
GUIFlags="8+128"
OverwriteMode="0"
InstallPath="C:\\Install\\Downloads"
ExtractPathText="Select extraction path"
ExtractPathTitle="FOO TITLE"
ExtractCancelText="Abort"
RunProgram="%%T\foo\setup.exe"
;!@InstallEnd@!

Any help?

¿Fue útil?

Solución

I figured it out. If the RunProgram variable is wrapped in a set of double quotes, it works for file paths with or without a space.

RunProgram="\"%%T\foo\setup.exe\""
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top