how to get installation folder in custom installer

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 122
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

how to get installation folder in custom installer

 
0
  #1
Jun 29th, 2009
i was able to create a shortcut name dynamically, now i need to link it to executable of my software. to do that i need to know where the software has been installed.

So the question is how to get installation folder in custom installer class?

Thanks.
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 88
Reputation: IdanS is an unknown quantity at this point 
Solved Threads: 12
IdanS IdanS is offline Offline
Junior Poster in Training

Re: how to get installation folder in custom installer

 
0
  #2
Jun 30th, 2009
Hi serkan sendur,

To get only the folder part of the path, use static method GetDirectoryName of Path class.
  1. using System.IO;
  2. using System.Windows.Forms;
  3.  
  4. string appPath = Path.GetDirectoryName(Application.ExecutablePath);

To get assembly in which the specified class is defined use method Assembly.GetAs­sembly (with the specified class type as a paramater). The assembly must be loaded. Next get assembly file path using Assembly.CodeBase property.
  1. using System.IO;
  2. using System.Reflection;
  3.  
  4. string path = Path.GetDirectoryName(
  5. Assembly.GetAssembly(typeof(MyClass)).CodeBase);

I hope its helps
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 449
Reputation: Ramesh S will become famous soon enough Ramesh S will become famous soon enough 
Solved Threads: 82
Ramesh S Ramesh S is offline Offline
Posting Pro in Training

Re: how to get installation folder in custom installer

 
1
  #3
Jun 30th, 2009
You can get this information from Installer.Context Property.

Check this link:
http://live.mscommunity.net/blogs/no...ler-class.aspx
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 122
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

Re: how to get installation folder in custom installer

 
0
  #4
Jun 30th, 2009
ok this problem is solved, i attach the example project to this post.
i was able to get the installation folder from within the custom installer class.
Attached Thumbnails
marty.jpg  
Attached Files
File Type: zip GetInstallationFolder.zip (430.8 KB, 20 views)
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC