jamesdeath123
jamesdeath123

Reputation: 4606

cscript.exe launched by inno setup installer says cannot find file while it is right there

In my Inno setup script, I have this line:

[Files]
Source: "C:\my.vbs"; DestDir: "C:\folder"; Flags: ignoreversion
[Run]
Filename: "cscript.exe C:\folder\my.vbs"; Description: "{cm:LaunchProgram,my}"; Flags: nowait postinstall skipifsilent runascurrentuser

but when the the installation is finished, it pop up an error saying: Unable to execute file: cscript.exe C:\folder\my.vbs Create process failed; code 2. the system cannot find the file specified.

When I go to C:\folder, the my.vbs is right there, why would it say it can't find the file?

Upvotes: 0

Views: 1237

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202534

The Filename parameter, as the name says, is a path to a (executable) file to execute. What in your case is cscript.exe.

The rest are parameters of that executable, which go to the Parameters parameter.

[Run]
Filename: "cscript.exe"; Parameters: "C:\folder\my.vbs"; \
    Description: "{cm:LaunchProgram,my}"; \
    Flags: nowait postinstall skipifsilent runascurrentuser

Upvotes: 1

Related Questions