C# how to Register exe? -


how find exe's path knowing name in .net?

would add name os environment variable? other application have 'register' somewhere else?

i need app start-up app b , call wcf services on it.

thanks!

to answer question: cannot know path knowing name. exe can reside anywhere on file system. there can multiple instances of don't know each other. multiple exe files different can have same name.

you take 1 of several approaches round this, depending on exe targetting:

  • get user browse exe using normal file browse dialog
  • search file system
  • see traces target exe leaves on system (filesystem, registry, environmental variables, etc) , use traces locate exe

for either of these options save result don't have execute again when app run next time.

searching filesystem take time, not guaranteed find exe (depending upon user level app running as) , may false positives, if app called dumb setup.exe.

getting user locate exe first time run possibly reliable way of locating it, have decide if app runs target exe no longer @ specified location, or user has chosen wrong exe.

if have control on app b (i.e. product), consider adding info known spot in registry when app b gets installed, app can locate easily. still need have plan b though in case info missing.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -