I've tried wording it a few ways and can't find the answer I'm looking for so apologies if this has been answered before.
I've made basic web browser, calculator and notepad apps and would like them to open from one form. I can open them fine at the moment, but my code references the file path the apps are found in. How can I write my code so that these apps will open when transferred to another computer? I.e. not being able to find the file path. This is my code that's working so far:
private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("C:\\Users\\Student User\\source\\repos\\Calculator2\\Calculator2\\bin\\debug\\Calculator2.exe");
}
private void button2_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("C:\\Users\\Student User\\source\\repos\\WebAppUni1\\WebAppUni1\\bin\\Debug\\WebAppUni1.exe");
}
private void button3_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("C:\\Users\\Student User\\source\\repos\\UniTextApp\\UniTextApp\\bin\\Debug\\UniTextApp.exe");
}
Would it just be a case of changing the file path to its new destination once ZIPped? Thanks!
What would stop someone from deploying the applications to different directories, or even disks? You can't know where they will install it, unless you provide an installer that properly installs and writes the installation location in the registry. And then you can read this location from the registry, and use it in your application.
So: provide an installer.