« Previous Next »

Not Answered Thread: runCommand in a manifest file?

Last post 10-02-2009 8:11 PM by Woland. 6 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (7 items)

Sort Posts:

  • 09-30-2009, 2:16 PM

    • k4k4sh1
    • Not Ranked
    • Joined on 09-30-2009, 5:59 PM
    • Posts 8

    runCommand in a manifest file?

    Is there a way to use the runCommand provider for MS Deploy in the manifest file? I've found that using -postsync:runcommand="some batch file call" results in the command running before some sql scripts and such defined in the Manifest.xml file using dbfullSql provider. I have not been able to find any documentation on the runCommand provider besides the command-line example, so I was wondering if runCommand is available for use in a manifest file at all. Also, the link to download the help file for the web deployment tool (http://go.microsoft.com/?linkid=8100895) that is posted on http://learn.iis.net/page.aspx/346/web-deployment-tool/ simply takes me to the same page.
  • 09-30-2009, 2:27 PM In reply to

    Re: runCommand in a manifest file?

    Yes you can use runCommand in a manifest file. I do see that the runcommand doc link is broken. I will make sure that this gets fixed. Here is a sample excerpt from the runCommand as regards to the manifest file.

    Using runCommand in a manifest file

    If you use runCommand entries in a manifest file, and the argument for runCommand contains special characters such as the conditional combination symbol "&&", you must convert the special characters into character entities (for example, "&amp;&amp;") so that the XML of the manifest file will be valid. For example, the following command calls a manifest file that uses the runCommand provider to stop the Web Deployment Agent Service and then start it if the stop command is successful.msdeploy -verb:sync -source:manifest=mymanifest.xml -dest:autoMymanifest.xml:<myManifest>   <runcommand path="net stop msdepsvc &amp;&amp; net start msdepsvc" waitInterval="5000"/></myManifest>

     Let us know if you need more information.

  • 09-30-2009, 8:36 PM In reply to

    • k4k4sh1
    • Not Ranked
    • Joined on 09-30-2009, 5:59 PM
    • Posts 8

    Re: runCommand in a manifest file?

    Thanks for the answer.

    This is what my manifest file looks like

    <MSDeploy.iisApp>
         <iisapp path="SiteName" />

      <dbfullSql path="msdeploy.config" transacted="false" />
      ...(more calls to providers)

      <runcommand path="(call to batch script here)" />
    </MSDeploy.iisApp>

    Everything in the manifest file runs fine, but it doesn't look like my command is actually running. A log of the outputs gives me this at the end where my command should have been called.

    Info: Adding child runcommand (MSDeploy.iisApp/runcommand).
     

    Am I missing something here? My script that I pass to runCommand compiles and runs a custom project.

  • 10-01-2009, 2:03 PM In reply to

    Re: runCommand in a manifest file?

    Its probably because your runcommand has a lower case in its name. The provider names provided in the manifest have to be the same case as the actual names.

    So just change runcommand to runCommand in your manifest as given below and it shoud work.

    <MSDeploy.iisApp>
         <iisapp path="SiteName" />

      <dbfullSql path="msdeploy.config" transacted="false" />
      ...(more calls to providers)

      <runCommand path="(call to batch script here)" />
    </MSDeploy.iisApp>

  • 10-01-2009, 4:13 PM In reply to

    • k4k4sh1
    • Not Ranked
    • Joined on 09-30-2009, 5:59 PM
    • Posts 8

    Re: runCommand in a manifest file?

    Hi, thanks for the reply. Unfortunately, I still get the same behavior (which I've already confirmed before my last post).

    Here is my simple, test manifest file:

    <TestManifest>
        <runCommand path="C:\Documents and Settings\User\My Documents\test.bat" />
    </TestManifest>

    test.bat contains a single echo command

    when I run the command:

    msdeploy.exe -verb:sync -source:manifest="C:\Documents and Settings\User\My Documents\manifest.xml" -dest:manifest="C:\Documents and Settings\User\My Documents\manifest.xml" -verbose

     Here is my output:


    Verbose: Performing synchronization pass #1.
    Verbose: Source runCommand (C:\Documents and Settings\User\My Documents\test.bat) does not match d
    estination (C:\Documents and Settings\User\My Documents\test.bat) differing in attributes (isSourc
    e['True','False']). Update pending.
    Info: Updating runCommand (C:\Documents and Settings\User\My Documents\test.bat).
    Verbose: The synchronization completed in 1 pass(es).
    Total changes: 1 (0 added, 0 deleted, 1 updated, 0 parameters changed, 0 bytes copied)

    While I do have doubts about whether I'm doing this right, you can hopefully see where I'm trying to go with this. Eventually, I'd like to incorporate this into a manifest file that get included in a zip package and have my commands run, as have been mentioned in the first post of this thread.

    Thanks in advance for your help.

  • 10-02-2009, 6:52 PM In reply to

    • Woland
    • Not Ranked
    • Joined on 04-07-2003, 5:38 PM
    • Los Angeles
    • Posts 12

    Re: runCommand in a manifest file?

    I get the same exception, is there more documentation on that topic? Anyone had success using runCommand?

  • 10-02-2009, 8:11 PM In reply to

    • Woland
    • Not Ranked
    • Joined on 04-07-2003, 5:38 PM
    • Los Angeles
    • Posts 12

    Re: runCommand in a manifest file?

    After more investigation I was able to narrow it down to the dest provider.

    If i use this, the command executes fine:

    "c:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe" -verb:sync -source:package="test.zip" -dest:manifest="C:\-\manifest2.xml" -debug -verbose

    MANIFEST FILE

    -------------------------------------

    <MSDeploy.iisApp>
       <iisapp path="SampleSite" />
       <runCommand path="c:\test.cmd"/>
    </MSDeploy.iisApp>

     

     If i change my dest to IIS, the command is not executed:

    "c:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe" -verb:sync -source:package="test.zip" -dest:iisApp="Default Web Site/SampleSite" -debug -verbose

    MANIFEST FILE

    -------------------------------------

    <MSDeploy.iisApp>
       <runCommand path="c:\test.cmd"/>
    </MSDeploy.iisApp>

Page 1 of 1 (7 items)
Microsoft Communities