I'm having issues with a self written application updater and when I launch the main program (in a sub folder) from the updater using Process.Start:

Folder Structure:
\Updater\
\Updater\Updater Workspace\
\Updater\Application\

The updater launches checks the version of the application in \Updater\Application\ compares it to the latest version (updates if necessary) and launches application.exe in \Updater\Application\

The application.exe on launch does a check for a user.prefs file and if its not found automatically creates this in \Updater\ instead of \Updater\Application\

Why wold process.start spawn the process in the same directory as the launching exe?

有帮助吗?

解决方案

Why wold process.start spawn the process in the same directory as the launching exe?

Unless you specified another directory, the working directory of the spawn process inherits from the parent process.

You can change this behavior by specifying a ProcessStartInfo parameter to Process.Start.

See Process.Start(ProcessStartInfo) and ProcessStartInfo.WorkingDirectory

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top