I have created DatePicker.exe
with Inno Setup.
Directory: C:\Program Files (x86)\MyJournal
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 8/17/2017 4:44 AM Log
-a---- 8/17/2017 3:30 PM 2747 appointments.bin
-a---- 8/17/2017 1:46 PM 45056 DatePicker.exe
-a---- 8/8/2017 8:35 AM 189 DatePicker.exe.config
-a---- 8/17/2017 1:46 PM 79360 DatePicker.pdb
-a---- 8/15/2017 10:17 AM 1122 DatePicker.SED
-a---- 8/17/2017 1:47 PM 12946 unins000.dat
-a---- 8/17/2017 1:47 PM 725157 unins000.exe
This does not work - DatePicker.exe
does not open, and there are no errors:
Process.Start(@"C:\Program Files (x86)\MyJournal\DatePicker.exe");
But this works
Process.Start(@"C:\Users\Public\Desktop\MyJournal.lnk");
Link from desktop points to the same path as above.
Why does the first example not work?
UPDATE.
As suggested I have tried to set the working directory. But no luck so far. This did not work for me.
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WorkingDirectory = @"C:\Program Files(x86)\MyJournal";
startInfo.FileName = @"DatePicker.exe";
startInfo.CreateNoWindow = true;
Process myProcess = Process.Start(startInfo);
UPDATE # 2;
It finally works with
var psi = new ProcessStartInfo(@"C:\Program Files (x86)\MyJournal\DatePicker.exe");
psi.WorkingDirectory = @"C:\Program Files (x86)\MyJournal";
Process.Start(psi);