views:

471

answers:

1

I have a visual studio deployment project with a custom action. I want to use that custom action to run a .bat file. As simple as this task sounds, it has got me stumped. It seems that within the context of the custom task .dll it doesn't see that bat file in the "Program Files" directory. Anyone have any pointers on this?

Just as an example:

[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
        public override void Commit(IDictionary savedState)
        {
            base.Commit(savedState);
            //System.Diagnostics.Process.Start("http://www.microsoft.com");            
            System.Diagnostics.Process.Start( @"C:\notepad.bat");
        }

if I get rid of the hardcoded path to the bat file it cannot find it even though it is in the installed program files directory. How do I work around this?

Thanks in advance!

A: 

Similar to this post. Maybe the answer will help you.

http://stackoverflow.com/questions/759969/custom-install-actions

David Stratton
The link you provided to this article proved very useful.http://www.devcity.net/Articles/339/1/article.aspxThanks
voam