none
Can not install an msi in StartUp?

    Question

  • I had seen that it was shown that one can install an .msi but somehow I can not get my msi to install so I tried a known one. Tortoise SVN msi. I have in my InstallItem.cmd

    echo off
    start /w msiexec.exe /i "%~dp0TortoiseSVN-1.7.6.22632-x64-svn-1.7.4.msi" /qn >> log.txt 2>> err.txt

    and for my app.config

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <system.diagnostics>
            <trace>
                <listeners>
                    <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                        name="AzureDiagnostics">
                        <filter type="" />
                    </add>
                </listeners>
            </trace>
        </system.diagnostics>
      <startup>
        <Task commandLine="InstallItem.cmd" executionContext="elevated" taskType="simple" />
      </startup>
    </configuration>

    Since I have done start-up before and the batch file might contain an extra character, I make sure its saved as ansi and it even runs fine when I remote in and run it manually, but somehow fails.

    No log.txt or err.txt is created either, so what is going on?

    I DO have the 'TortoiseSVN-1.7.6.22632-x64-svn-1.7.4.msi' included in the project as 'Copy always' with no build and like I said, the batch file runs fine when RDPed in.

    Any ideas?

    Oh by the way, my WorkerRole is empty really:

    public override void Run()
            {
                // This is a sample worker implementation. Replace with your logic.
                Trace.WriteLine("$projectname$ entry point called", "Information");
                File.WriteAllText("StartMessages.txt", "Run started...");
    
                while (true)
                {
                    Thread.Sleep(10000);
                    Trace.WriteLine("Working", "Information");
                }
            }


    noorbakhsh حميد نوربخش

    Wednesday, May 16, 2012 8:56 PM

Answers

  • I just noticed from your original post that it looks like your <startup> node is in app.config instead of ServiceDefinition.csdef. And it should be capitalized ("<Startup>").

    • Marked as answer by noorbakhsh Thursday, May 17, 2012 6:09 PM
    Thursday, May 17, 2012 5:17 PM

All replies

  • I don't think msiexec outputs anything to stdout and stderr. The "/l" option may be a better way to capture MSI logs.
    Thursday, May 17, 2012 5:05 AM
  • Thanks Steve,

    Actually both links above are from your blog. If I run the cmd file when RDPed in, it runs fine (with log and err created, but empty as you mentioned) but it DOES install, but not with the StartUp task.

    I am puzzled since I have used the StartUp to register ports and set up WCF service, but the install does not occur and originally I thought it might be my installer, so I tried third part installer as you can see.

    Anyone having success with running msiexec.exe for simple installs?


    noorbakhsh حميد نوربخش

    Thursday, May 17, 2012 2:48 PM
  • I've had plenty of success with it. :-)

    Did you try my suggestion above to capture the log from the MSI? If so, what was in the log?

    Thursday, May 17, 2012 3:14 PM
  • Steve,

    I changed my InstallItem.cmd to

    echo off
    start /w msiexec.exe /i "%~dp0TortoiseSVN-1.7.6.22632-x64-svn-1.7.4.msi" /qn /l* "%~dp0InstallLog.txt"

    and published my project. No InstallLog.txt! I ran the cmd file locally and it got created with log, so I think the StartUp is not even getting hit which is weird since I have successfully used it to launch 32 bit process previously and it not very complicated this time. Just a 'simple', elevated commandLine one!

      <startup>
        <Task commandLine="InstallItem.cmd" executionContext="elevated" taskType="simple" />
      </startup>

    The batch file is loaded up correctly in the approot, so why isn't it running? Any gotchas I have overlooked?


    noorbakhsh حميد نوربخش

    Thursday, May 17, 2012 4:07 PM
  • I just noticed from your original post that it looks like your <startup> node is in app.config instead of ServiceDefinition.csdef. And it should be capitalized ("<Startup>").

    • Marked as answer by noorbakhsh Thursday, May 17, 2012 6:09 PM
    Thursday, May 17, 2012 5:17 PM
  • Steve,

    You are the man. In all my other projects I have the startup both in the app.config and ServiceDefinition.csdef, but was missing from the latter in this case. That made the install work.

    Do I even need it in the app.config? I think I happen to put it there originally and its always stuck there also.


    noorbakhsh حميد نوربخش

    Thursday, May 17, 2012 6:08 PM
  • No, you don't need it in app.config. I'm actually somewhat surprised it's not a syntax error. (Perhaps app.config parsing simply ignores unknown tags.)
    Thursday, May 17, 2012 7:16 PM