| | |
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:
Solved Threads: 122
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.
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.
•
•
Join Date: Jun 2009
Posts: 88
Reputation:
Solved Threads: 12
Hi serkan sendur,
To get only the folder part of the path, use static method GetDirectoryName of Path class.
To get assembly in which the specified class is defined use method Assembly.GetAssembly (with the specified class type as a paramater). The assembly must be loaded. Next get assembly file path using Assembly.CodeBase property.
I hope its helps
To get only the folder part of the path, use static method GetDirectoryName of Path class.
C# Syntax (Toggle Plain Text)
using System.IO; using System.Windows.Forms; string appPath = Path.GetDirectoryName(Application.ExecutablePath);
To get assembly in which the specified class is defined use method Assembly.GetAssembly (with the specified class type as a paramater). The assembly must be loaded. Next get assembly file path using Assembly.CodeBase property.
C# Syntax (Toggle Plain Text)
using System.IO; using System.Reflection; string path = Path.GetDirectoryName( Assembly.GetAssembly(typeof(MyClass)).CodeBase);
I hope its helps
•
•
Join Date: Jun 2009
Posts: 449
Reputation:
Solved Threads: 82
You can get this information from Installer.Context Property.
Check this link:
http://live.mscommunity.net/blogs/no...ler-class.aspx
Check this link:
http://live.mscommunity.net/blogs/no...ler-class.aspx
![]() |
Similar Threads
- how to debug custom installer (C#)
- C in Vista (C)
- Tired of trying php 5 and mysql 5 to work together? (PHP)
- xp freezes just after loading screen (Windows NT / 2000 / XP)
- How to get the Virtual Directory's physical path... (ASP.NET)
- How to include Access and Crystal Report in Setup file (Visual Basic 4 / 5 / 6)
- For sheurwayne, Re:" my computer is always crashing" (Viruses, Spyware and other Nasties)
- modify script (Perl)
- new window in Internet Explorer is always blank (Web Browsers)
Other Threads in the C# Forum
- Previous Thread: Dispose in asp.net
- Next Thread: Scanning for bluetooth devices
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagridview dataset datetime degrees development draganddrop drawing encryption enum excel file files form format forms ftp function gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






