5 Replies Latest reply on Jun 8, 2011 8:26 AM by MattGagliardi

    Problem running Windows Application Package

    MattGagliardi Enthusiast

      I'm hoping that someone can step in and quickly answer what I'm sure is an easy question but one that's got me beating my head against a wall.  I'm trying to build a Windows appliance and in the stepped method I've been working I've had a great deal of success...to this point I've got the OS going in, users being created, Windows components and other software packages installing correctly, etc.

       

      However, I am trying to run a simple .exe that's got some arguments which will "prep" a SQL database for me.  Unfortunately it continues to fail.  I've tried running it multiple ways...as a program, called in a batch file, a VBS script, etc.  All of them are failing.  FWIW I have run the same command in a regular CMD window and it succeeds.  Here's what I'm trying (at present running as a "Program" in the package builder):

       

      vi.database.install.consoleapp.exe --setupServer "--product=VitreaWeb_1.1 --sqlDir=. --server=VIMS\VIMSSQLEXP --user=sa --password=Vital$23"

       

      When I run in a command line I don't have any quotes (and it works)...however that doesn't play in Studio.  I get immediate errors if I try that.  Using quotes in the above locations has gotten me as far as I've made it.  At this point I'm receiving an error that "server has no argument".  I'm sure that I've managed to botch the location of the quotes, but I'll be damned if I can figure out where they need to go.

       

      If anyone could help me out with this I'd really appreciate it.

       

      Thanks!

        • 1. Re: Problem running Windows Application Package
          asharpe Hot Shot
          VMware Employees

          What immediate errors do you get without the quotes? Perhaps you should try

          hard quotes (single quotes) around the password argument, and single quote

          around the server argument. Or, perhaps two \ in the server argument so that

          the \ is quoted.

           

          Andrew

          • 2. Re: Problem running Windows Application Package
            MattGagliardi Enthusiast

            Without the quotes I get an error that the .exe can't be found.  I swear this is driving me insane.

            • 3. Re: Problem running Windows Application Package
              MattGagliardi Enthusiast

              I've been able to fill in the blanks a little bit more by keeping the remnant VM around when the build fails.  I've now got the quotes in the right place and the arguments are being correctly passed to the .exe.  I can now see (via the log that the .exe generates) that it's kicking off correctly and attempting to run a .sql statement.  That's now what is failing.  I'm getting a "can't find the file specified" message...which I think is actually a problem finding the "sqlcmd" program.

               

              So...in the remnant machine if I log in and run the initial command manually everything works great and the generated logfile shows that the .sql statement succeeded (the line in the successful logfile is something like "sqlcmd -option -option -option server.sql".  In the unsuccessful logfile I see it call for the server.sql file (which is definitely in the directory), but the next line is "can't find file specified".

               

              Pure supposition on my part (I didn't write the damn .exe) is that the WAP is not able to call sqlcmd.  Some kind of path issue perhaps?  Do I need to be doing something in Studio to make sure that it can find/call sqlcmd?

              • 4. Re: Problem running Windows Application Package
                MattGagliardi Enthusiast

                Perhaps a better question, since this always seems to work A-OK on the remnant VM after the package installation has failed...

                 

                How do I get the command to run "on" the appliance that I'm creating (using files, paths, etc. that are truly local to that machine) rather than from the Windows package that I've created?  So if I want to simply switch from P: to C: and run a command from there, what would I do?  I've attempted this (via batch file):

                 

                C:

                cd \Program Files (x86)\blah\blah\bin

                applicationinstaller.exe -option -option -option

                 

                But it's not worked.

                 

                I swear, it's a good thing I only work on the second floor or I'd be tempted to jump out the window.

                • 5. Re: Problem running Windows Application Package
                  MattGagliardi Enthusiast

                  OK, I figured out the problem...the .exe I was calling relys on updated PATH information, which hadn't yet been updated as I'd not rebooted from a previous install.  As soon as I put a reboot into the package installation process what I was trying to do worked perfectly.