How to use Grunt to spawn a windows command line with special character?

Jason

I'm on windows. To build my application I used to do a lot of manual file manipulations and, at the last step, to run this command:

"c:\Program Files\Inno Setup 5\ISCC.exe" /dType=server /dBits=32 /dArchAllowed="x86 x64" config.iss

Please note that the /d option is to pass some custom variables to Inno Setup.

Recently things changed and we decided to automate the task using Grunt. All the file manipulations are working fine. But I'm not able to do the last step (to run the command line) correctly.

I tried:

grunt.task.registerTask('create-exe', 'create the installer', spawnTask({
    cmd: 'c:\\Program Files\\Inno Setup 5\\ISCC.exe', 
    args: ['/dType=server' , '/dBits=32' ,'/dArchAllowed="x86 x64"', 'config.iss' ]
}));

But Inno Setup is not happy:

stderr: 'Error on line 38 in config.iss: 
Value of [Setup] section directive "ArchitecturesAllowed" is invalid.',

So, something is wrong with the argument /dArchAllowed="x86 x64" (and if I remove it it is running. But I need this argument.) It's a nasty one: it has double quotes, equal and space! I tried a lot of combinations to escape the special characters but without success.

Any Idea? Thanks!

Jason

I found the answer on this help page.

The /d command line compiler parameter values cannot be surrounded by double quotes. So, I just replaced '/dArchAllowed="x86 x64"' with '/dArchAllowed=x86 x64' in the args property.

The whole grunt task is:

grunt.task.registerTask('create-exe', 'create the installer', spawnTask({
    cmd: 'c:\\Program Files\\Inno Setup 5\\ISCC.exe', 
    args: ['/dType=server' , '/dBits=32' ,'/dArchAllowed=x86 x64', 'config.iss' ]
}));

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

What was the meaning of a special character on the shebang line?

분류에서Dev

In nodejs on windows, how do I use the `uid` option with child_process.spawn?

분류에서Dev

How to escape '<' character for use within php echo command

분류에서Dev

How to use SVG with grunt and jade

분류에서Dev

How to extract attachments from EML files with Windows command line?

분류에서Dev

How to convert a windows batch file into a signle line "cmd /c" command?

분류에서Dev

How do you create an empty file from the command line in Windows

분류에서Dev

How to run regex find and replace using windows command line

분류에서Dev

How to disable write caching on windows 8 drive via command line

분류에서Dev

How to paste complex passwords into windows command line (shell)?

분류에서Dev

How do I copy the directory and its folders in windows command line?

분류에서Dev

remove special character from string in snowpipe copy command in snowflake

분류에서Dev

permission script with stat command trouble awk special character

분류에서Dev

How to make a batch file to use Flex command line debugger?

분류에서Dev

How to use the Command-line Parameters to select then change a group of filenames

분류에서Dev

How to use 'itextESC' when using ex as a text editor in command line?

분류에서Dev

How to produce this special character for html displaying?

분류에서Dev

Windows - is there a way to see what apps spawn/use which processes?

분류에서Dev

Windows command line alias commands

분류에서Dev

Pipe output of command line by line in Windows

분류에서Dev

spawn - command not found!

분류에서Dev

Spawn command not found

분류에서Dev

mockserver-grunt Error spawn java ENOENT

분류에서Dev

Net use Command : Windows CE

분류에서Dev

How can I run a command with grunt-shell with elevated privileges?

분류에서Dev

cat command appears to be adding extra $ character at the end of each line

분류에서Dev

How to solve Url encode and decode issue with some special character and numbers

분류에서Dev

How to remove special 'M-BM-' character with sed

분류에서Dev

Jenkins - windows command line task failure

Related 관련 기사

  1. 1

    What was the meaning of a special character on the shebang line?

  2. 2

    In nodejs on windows, how do I use the `uid` option with child_process.spawn?

  3. 3

    How to escape '<' character for use within php echo command

  4. 4

    How to use SVG with grunt and jade

  5. 5

    How to extract attachments from EML files with Windows command line?

  6. 6

    How to convert a windows batch file into a signle line "cmd /c" command?

  7. 7

    How do you create an empty file from the command line in Windows

  8. 8

    How to run regex find and replace using windows command line

  9. 9

    How to disable write caching on windows 8 drive via command line

  10. 10

    How to paste complex passwords into windows command line (shell)?

  11. 11

    How do I copy the directory and its folders in windows command line?

  12. 12

    remove special character from string in snowpipe copy command in snowflake

  13. 13

    permission script with stat command trouble awk special character

  14. 14

    How to make a batch file to use Flex command line debugger?

  15. 15

    How to use the Command-line Parameters to select then change a group of filenames

  16. 16

    How to use 'itextESC' when using ex as a text editor in command line?

  17. 17

    How to produce this special character for html displaying?

  18. 18

    Windows - is there a way to see what apps spawn/use which processes?

  19. 19

    Windows command line alias commands

  20. 20

    Pipe output of command line by line in Windows

  21. 21

    spawn - command not found!

  22. 22

    Spawn command not found

  23. 23

    mockserver-grunt Error spawn java ENOENT

  24. 24

    Net use Command : Windows CE

  25. 25

    How can I run a command with grunt-shell with elevated privileges?

  26. 26

    cat command appears to be adding extra $ character at the end of each line

  27. 27

    How to solve Url encode and decode issue with some special character and numbers

  28. 28

    How to remove special 'M-BM-' character with sed

  29. 29

    Jenkins - windows command line task failure

뜨겁다태그

보관