We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

runCommand in a manifest file?RSS

9 replies

Last post Jan 29, 2010 12:38 PM by tusmester

  • runCommand in a manifest file?

    Sep 30, 2009 02:16 PM|k4k4sh1|LINK

    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.

    msdeploy IIS6.0 manifest.xml

  • Re: runCommand in a manifest file?

    Sep 30, 2009 02:27 PM|moshaikh|LINK

    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.

  • Re: runCommand in a manifest file?

    Sep 30, 2009 08:36 PM|k4k4sh1|LINK

    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.

    msdeploy IIS6.0 manifest.xml

  • Re: runCommand in a manifest file?

    Oct 01, 2009 02:03 PM|moshaikh|LINK

    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>

  • Re: runCommand in a manifest file?

    Oct 01, 2009 04:13 PM|k4k4sh1|LINK

    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.

  • Re: runCommand in a manifest file?

    Oct 02, 2009 06:52 PM|Woland|LINK

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

  • Re: runCommand in a manifest file?

    Oct 02, 2009 08:11 PM|Woland|LINK

    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>

  • Re: runCommand in a manifest file?

    Jan 29, 2010 06:20 AM|tusmester|LINK

     Hi, it seems that I have a similar problem:

    - trying to import a package in IIS7
    - everything in the manifest.xml gets executed (sql scripts, etc.), except the last runCommand. I've tried it with different parameters, but didn't suceed

    The manifest file looks like this:

    <?xml version="1.0" encoding="utf-8" ?>
    <msdeploy.iisApp>
      <iisApp path="..." />
      <setAcl path="..." setAclAccess="Read, Write, Modify" />
      <dbfullsql path="....sql" transacted="false" />
     
      <runCommand path="ConfigureIISSite.bat" />
    </msdeploy.iisApp>

    What I'm trying to achieve in the bat file is, to set the authentication mode of the destination site to Windows.

    runcommand msdeploy

  • Re: runCommand in a manifest file?

    Jan 29, 2010 11:46 AM|moshaikh|LINK

    The runCommand path should be an absolute path and the destination should be either a manifest file or auto. 

    What is the msdeploy command you are executing.

    Can you make these changes and re-run with -verbose and let us know.

    If you use auto, the command will be:

    msdeploy -verb:sync -source:manifest=c:\srcmanifest.xml -dest:auto,computername=computername

     

  • Re: runCommand in a manifest file?

    Jan 29, 2010 12:38 PM|tusmester|LINK

    Thanks :)
    Actually I tried to import the package in IIS manager (web site right click, Deploy -> Import Application...). The final goal is to make this work with Web Platform Installer.

    WebPI makes the website for our app, and than executes msdeploy somehow with the package...

    Of course for test purposes, I'll try the command line way, but it seems that these two environments are a little bit different...