Click here to Skip to main content
       

.NET Framework

 
GeneralRe: System Colours PinmemberSimon Stevens17-Feb-07 3:01 
AnswerRe: System Colours PinprotectorHeath Stewart17-Feb-07 7:07 
GeneralRe: System Colours PinmemberSimon Stevens18-Feb-07 23:02 
QuestionHow to write NUNIT Test Cases for Crystal Reports? PinmemberHarshal Nemade15-Feb-07 23:19 
QuestionMonitor Chat Server Using WMI in c# .net PinmemberMember #182410015-Feb-07 21:48 
AnswerRe: Monitor Chat Server Using WMI in c# .net PinmvpDave Kreskowiak16-Feb-07 9:40 
QuestionDeploying application forms of C# in VS.NET PinmemberEyungwah15-Feb-07 12:25 
AnswerRe: Deploying application forms of C# in VS.NET PinmemberZoltan Balazs15-Feb-07 14:04 
QuestionDeployment question PinmemberJoltWork15-Feb-07 8:01 
AnswerRe: Deployment question PinprotectorHeath Stewart17-Feb-07 7:10 
GeneralRe: Deployment question PinmemberJoltWork21-Feb-07 3:24 
GeneralRe: Deployment question PinprotectorHeath Stewart21-Feb-07 5:13 
GeneralRe: Deployment question PinmemberJoltWork21-Feb-07 7:19 
AnswerRe: Deployment question Pinmemberperlmunger21-Feb-07 8:01 
If you create your own project installer (System.Configuration.Install.Installer), you can easily get the install path by just using reflection on the executing assembly. Here is some code I use to do this in my installer:
/// Since this assembly is being run from the install directory, it will return the full
/// path to this assembly. You can simple get the directory path using a FileInfo object
/// to know where it's been installed.
System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
string baseAppDir = (new System.IO.FileInfo( asm.Location )).DirectoryName;
 
/// We're certain this exists because our setup program created it.
RegistryKey softwareKey = Microsoft.Win32.Registry.LocalMachine
               .OpenSubKey( "Software", true )
               .OpenSubKey( "Company Name", true )
               .OpenSubKey( "Application Name", true );
 
softwareKey.SetValue( "InstallLocation", configFilepath );
Keep in mind that I added a registry value in setup project that creates the HKLM\Software\Company Name\Application Name\InstallLocation key with some default or empty value. The setup project actually creates the keys you specified in the registry editor part of the setup project before it calls your code in the Installer class.
 
-Matt
 
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall

QuestionTransaction on Dataset in ADO.net Pinmemberneerajxp15-Feb-07 6:35 
AnswerRe: Transaction on Dataset in ADO.net PinmvpColin Angus Mackay15-Feb-07 7:03 
QuestionGeneric Signatures on remoting objects PinmemberLukeHammond15-Feb-07 4:00 
QuestionRe: Generic Signatures on remoting objects PinmemberLukeHammond15-Feb-07 4:03 
QuestionRe: Generic Signatures on remoting objects PinmemberLukeHammond15-Feb-07 4:11 
QuestionHow to create synchronous socket? PinmemberBanks K14-Feb-07 23:19 
Questiondraw the shapes on top of the controls... Pinmembersathishtl00714-Feb-07 20:36 
AnswerRe: draw the shapes on top of the controls... PinmemberSimon Stevens17-Feb-07 3:42 
QuestionCalling C# method from a JavaScript program Pinmemberearlgraham14-Feb-07 13:14 
AnswerRe: Calling C# method from a JavaScript program PinmemberNavaneethkn14-Feb-07 19:05 
AnswerRe: Calling C# method from a JavaScript program Pinmemberperlmunger21-Feb-07 8:08 
GeneralRe: Calling C# method from a JavaScript program Pinmemberearlgraham22-Feb-07 12:10 
QuestionPerfomance of application Pinmembercocoonwls14-Feb-07 11:57 
AnswerRe: Perfomance of application PinmemberLuc Pattyn14-Feb-07 12:09 
GeneralRe: Perfomance of application Pinmembercocoonwls14-Feb-07 12:28 
GeneralRe: Perfomance of application PinmemberLuc Pattyn14-Feb-07 12:40 
GeneralRe: Perfomance of application Pinmembercocoonwls14-Feb-07 12:58 
GeneralRe: Perfomance of application PinmemberLuc Pattyn14-Feb-07 13:06 
GeneralRe: Perfomance of application Pinmembercocoonwls14-Feb-07 13:21 
GeneralRe: Perfomance of application PinmemberLuc Pattyn14-Feb-07 13:37 
GeneralRe: Perfomance of application PinmemberIqbal M Khan14-Feb-07 21:09 
AnswerRe: Perfomance of application PinprotectorHeath Stewart17-Feb-07 7:15 
QuestionProblems with getProcessesByName Pinmemberderbrink14-Feb-07 4:31 
AnswerRe: Problems with getProcessesByName PinmemberLuc Pattyn14-Feb-07 7:51 
QuestionFixed a window Form PinmemberParameswar Mala14-Feb-07 2:27 
AnswerRe: Fixed a window Form PinprotectorHeath Stewart17-Feb-07 7:25 
QuestionMenuItem Compact Framework [modified] Pinmemberdanaelx14-Feb-07 2:11 
QuestionResolution Problem. PinmemberParameswar Mal14-Feb-07 2:06 
AnswerRe: Resolution Problem. PinmemberLuc Pattyn14-Feb-07 7:54 
AnswerRe: Resolution Problem. PinmemberNavaneethkn14-Feb-07 19:34 
QuestionIs it possible to run a vb.net application without Visual Studio?? PinmemberChina-Gary13-Feb-07 13:41 
AnswerRe: Is it possible to run a vb.net application without Visual Studio?? PinmemberPete O'Hanlon14-Feb-07 2:42 
QuestionCharmap - Like control? PinmemberPhoenixHawk13-Feb-07 6:40 
AnswerRe: Charmap - Like control? PinmemberEd.Poore14-Feb-07 7:45 
AnswerRe: Charmap - Like control? PinmemberRay Cassick16-Feb-07 11:35 
QuestionDoes the System.Diagnostics.Process.Kill() trigger an event? Pinmemberjeremy.t13-Feb-07 6:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 23 Nov 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid