VMware Cloud Community
JayArthurJayArt
Contributor
Contributor

Installbuilder error when opening Excel file

Unknown error while running open "~\Documents\QI Macros Test Data\QIMacros-Tutorial.xlsx"

 

I’m trying to open an Excel file in the <postInstallationActionList> after I install my Excel Addin.

This is what I took from 8. Actions: the open command can be also used to open regular files, which will launch the associated application:

 

        <runProgram>

            <program>open</program>

            <programArguments>"~\Documents\QI Macros Test Data\QIMacros-Tutorial.xlsx"</programArguments>

        </runProgram>

 

I installed the file earlier in the build, so I know it’s there.

How do I get this to work?

0 Kudos
5 Replies
gongomgra
VMware Employee
VMware Employee

Hi @JayArthurJayArt ,

Thanks for your message. The open command is only available in OS X, is that the platform you are using? If that's the case, notice that paths are delimited by the / character instead of \ (Windows). Can you check if the snippet below helps?

 

      <runProgram>
            <program>open</program>
            <programArguments>"~/Documents/QI Macros Test Data/QIMacros-Tutorial.xlsx"</programArguments>
      </runProgram>

0 Kudos
JayArthurJayArt
Contributor
Contributor

Is there a way to do this in Windows

0 Kudos
gongomgra
VMware Employee
VMware Employee

Hi,

On Windows you can try the snippet below, but take into account the '~' directory doesn't exist on Windows. It defines the user's home directory on UNIX platforms. For Windows I think you can use %USERPROFILE%

<runProgram>
    <program>cmd</program>
    <programArguments>/C start "%USERPROFILE%\Documents\QI Macros Test Data\QIMacros-Tutorial.xlsx"</programArguments>
</runProgram>

0 Kudos
JayArthurJayArt
Contributor
Contributor

I gave it a try, but nothing happened.

Changed code to:

<runProgram>
<program>cmd</program>
<programArguments>start "%USERPROFILE%\Documents\QI Macros Test Data\QIMacros-Tutorial.xlsx"</programArguments>
<useMSDOSPath>1</useMSDOSPath>
</runProgram>

Installer froze. Did not open file. Did not complete installation. Had to cancel install.

Error log:

<program> : "cmd" -> "cmd"
<programArguments> : "start "%USERPROFILE%\Documents\QI Macros Test Data\QIMacros-Tutorial.xlsx"" -> "start "%USERPROFILE%\Documents\QI Macros Test Data\QIMacros-Tutorial.xlsx""
<progressText> : "" -> ""
<ruleEvaluationLogic> : "and" -> "and"
<run> : "1" -> "1"
<runAs> : "" -> ""
<runAsShell> : "" -> ""
<show> : "1" -> "1"
<showMessageOnError> : "1" -> "1"
<stdin> : "" -> ""
<useMSDOSPath> : "1" -> "1"
<workingDirectory> : "" -> ""

No rules provided, returning 'true'
Rules match
Executing cmd start "%USERPROFILE%\Documents\QI Macros Test Data\QIMacros-Tutorial.xlsx"

 

At this point installation froze and I had to abort installation:

Executing <installationAbortedActionList>

0 Kudos
michieldhont_
Hot Shot
Hot Shot

Hi @JayArthurJayArt,

In your example it seems you are not using the /C flag as it is shown in the example, could you try that?

<runProgram>
    <program>cmd</program>
    <programArguments>/C start "%USERPROFILE%\Documents\QI Macros Test Data\QIMacros-Tutorial.xlsx"</programArguments>
</runProgram>

 

Regards,

Michiel

0 Kudos