November 24, 2012

Installation is Rolled-back while creating the VirtualDirectory?

We have a Basic MSI Project created in InstallShield 2012 SP1, which packages a Simple .Net web application. First release of the product was gone, the Installation and uninstallation is working fine.
While making some incremental changes to the installer during second release the installer fails to create the Virtual Directory and started rolling back the installation.

Further exploration revealed that the Installation rollback happens while creating a mapping between the IIS Application and Physical path. There can be two reasons that the installation gets rolled-back while creating a mapping between IIS Application and Physical path.

1. If the web.config is in read only the installation will roll back as it can’t edit the file. But I am not attempting to explictly edit the web.config file while creating the virtual directory.
2. If you are trying to map the website to an empty folder then also it will rollback. A valid point:).. why do you want to create a website without any file?

So please make sure that the web.config file's read-only attribute is removed before bundling the file with the installer.

Note: The contents in this article is verified in InstallShield 2012 SP1 Premier Editions with Basic MSI Project.

4 comments:

  1. Thanks, That helped, I couldnt work out why the install was working find yesterday and not this morning. I checked everything in to source control yesterday and tried to rebuild this morning. Obviously the web config was read only.

    I have copied this post and linked to your site from my blog. Hpoe you dont mind :)

    ReplyDelete
  2. Great to know that it has helped you..
    No issues in re-posting, as long as it helps people!

    Thanks
    Bhuvana

    ReplyDelete
  3. one more thing - if you like me are using a TFS (or other source control), then to make the file Read only need to check it out from the Source Control. this fixed it for me.

    ReplyDelete
  4. Thanks for sharing the info, Eyal.

    Regards
    Bhuvana

    ReplyDelete