Closed cupper1 closed 2 years ago
You can use GetExecutingAssembly() to get the location of your program in the \myapp-1.2.0
System.Reflection.Assembly.GetExecutingAssembly().Location
output: "C:\Users\<USER>\AppData\Local\<AppName>\app-2.1.4\application.exe"
To get the folder "C:\Users\
mgr.CreateShortcutForThisExe(ShortcutLocation.StartMenu | ShortcutLocation.Desktop);
RegisterFileTypes(mgr.AppDirectory);
If you want to find the root (where your app is installed) then UpdateManager.AppDirectory
is the correct one.
If you want to know where your exe is currently executing, there is a helper built right into Squirrel for this: SquirrelRuntimeInfo.EntryExePath
. Since Assembly.Location
returns null when PublishSingleFile is true, it's now better to use Process.GetCurrentProcess()
to find the file path of your executing binary.
Hi, I have another question / Concern... When my app starts it needs another dependency that even the "self-contained" does not handle. That is fine, I include a small installer for it, but when I have tried the application.startuppath + \install\mysetup.exe" it doesn't work.
So I went looking and the installer has created a app.exe in the main folder, and then a version subfolder \myapp-1.2.0. It is this subfolder that includes the \install\mysetup.exe. How in code can I reference this specific place?
Thanks!