0

I followed this link http://www.codeproject.com/Articles/19560/Launching-Your-Application-After-Install-using-Vis & it has given a good guid to my problem. But in my scenario, I also have a folder with the exe. after installation my exe starts running. but it is not properly linked with the conetent in my folder which is also in same location. How can I link that folder to my exe.

The problem is I added both folder & its contents to Application folder directory given by the setup project wizard. But I can add only the exe to the commit folder as I want my exe to run after after clicking on first initial exe. How ever after first installation both my exe & folder creates & when I click on exe manually it works. But in installation it only copies exe & folder & start running copied exe but could nt find the folder properly.

2 Answers 2

1

The working directory of your exe will be different when launched as a commit action.

You either need to change the working directory in your exe or build an absolute path to the folder you are trying to find.

You could pass the application path from the installer to your exe by setting CustomActionData to '[TARGETDIR]\', or extract it from the exe path at runtime, e.g.:

string exepath = Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]);
string abspath = Path.Combine(exepath, "yoursubfolder");
Sign up to request clarification or add additional context in comments.

1 Comment

Hi @PhilMY, I've created my windows setup using visual studio 2010. Its all working fine, but after successful install, it's not launching automatically when copy my exe to other location apart from application location. Please help me
0

I think this is what you want

http://blogs.msdn.com/b/astebner/archive/2006/08/12/696833.aspx

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.