I am distributing a desktop application with Windows Installer. In the commit, there is a custom action that launches the just installed application. It seems to run well but the started application cannot see the network drives that are mapped... If I exit the app and start it from the start menu, the app can see the network drives without problem. This app needs to read from the network...
Here is the code I use in the commit action:
ProcessStartInfo^ proc = gcnew ProcessStartInfo();
proc->UseShellExecute = true;
proc->FileName=mytargetdir + "program.exe";
try
{
Process::Start(proc);
}
catch(Exception^ e)
{
// Do nothing and return directly ...
}
I am assuming that I need to provide the current user credentials to the process but I cannot know them a priory. I can get the current user and domain with Environment but what about the password...?
how to launch the app with access to the network?