hello, i use setInstallerVariableFromScriptOutput to get some files in the directory in windows.

<setinstallervariablefromscriptoutput> <exec>dir</exec> <execargs>/s /b </execargs> <name>DB_INIT_SCRIPTS</name> <workingdirectory>${installdir}/mysql/dbscripts/init/</workingdirectory> </setinstallervariablefromscriptoutput>

the command runs well manully but installbuilder throw an error, what's wrong?

the following is the debug log: Setting variable DB_INIT_SCRIPTS from dir /s /b

/usr/bin/dir: cannot access /s: No such file or directory /usr/bin/dir: cannot access /b: No such file or directory Exit code: 2 Script exit code: 2

Script output:

Script stderr: /usr/bin/dir: cannot access /s: No such file or directory /usr/bin/dir: cannot access /b: No such file or directory

or can u tell me how to execute MS-DOS command like 'dir' in this case?

asked 09 Apr '12, 03:52

laiyongyong's gravatar image

laiyongyong
1131314
accept rate: 0%


The weird part is the installer resolving dir to /usr/bin/dir. Could you confirm that you are executing that on Windows?

In addition, could you try executing:

<setInstallerVariableFromScriptOutput>
    <exec>cmd</exec>
    <name>DB_INIT_SCRIPTS</name>
    <execArgs>/C dir /s /b</execArgs>
</setInstallerVariableFromScriptOutput>
link

answered 09 Apr '12, 17:05

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Thanks for your reply. I found cygwin on my windows machine, maybe it's why i got /usr/bin/dir: after i removed cygwin, the following xml code still can work:

<setinstallervariablefromscriptoutput> <exec>dir</exec> <name>DB_INIT_SCRIPTS</name> <execargs>/s /b</execargs> </setinstallervariablefromscriptoutput>

but your method works well:

<setinstallervariablefromscriptoutput> <exec>cmd</exec> <name>DB_INIT_SCRIPTS</name> <execargs>/C dir /s /b</execargs> </setinstallervariablefromscriptoutput>

(09 Apr '12, 23:08) laiyongyong

hi, i fix the issue using following xml code:

<actionList>
    <setInstallerVariableFromScriptOutput>
        <exec>cmd</exec>
        <execArgs>/C dir /s /b </execArgs>
        <name>DB_INIT_SCRIPTS</name>
        <workingDirectory>${installdir.dos}/mysql/dbscripts/init/</workingDirectory>
    </setInstallerVariableFromScriptOutput>
    <foreach>
        <progressText>${msg(Installer.Progress.creatingTables.info)}</progressText>
        <values>${DB_INIT_SCRIPTS.escape_backslashes}</values>
        <variables>script</variables>
        <actionList>
            <showInfo>
                <text>${script}</text>
            </showInfo>
        </actionList>
    </foreach>
</actionList>

i try many times until i saw the user guid "4.2 Modifier Suffixes". thanks anyway

link

answered 10 Apr '12, 04:57

laiyongyong's gravatar image

laiyongyong
1131314
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×6
×5

Asked: 09 Apr '12, 03:52

Seen: 1,430 times

Last updated: 10 Apr '12, 04:57