I know that [TARGETDIR] will get me the installation Directory, but I also want the name of the executable. I think it should be something like [TARGETDIR][OUTPUTPATH] or maybe just [OUTPUTPATH], but I can't find anything on a installer property that contains the name of the executable that I'm installing.
I need this information to put in the registry at install-time. I know I can do it with a custom action from my project, but I'd rather just use the installer properties if I can.
I think [AssemblyPath] might work
(don't have it in front me to test, if I recall right)
1) passing [TARGETDIR] to a custom action as described at http://msdn.microsoft.com/en-us/library/9cdb5eda%28v=vs.100%29.aspx
2) using basic System.IO to search that directory for "*.exe" files in the OnAfterInstall method of the custom action. In my case, there is only 1 .exe file so I can be certain that is the application I just installed. (I can then add that path to the registry or do whatever I want - jww 2012-04-05 23:56
Context.Parameters["TargetDir"]
no need to pass anything (I guess you did just that). And if you're calling it from the same 'exe' (i.e. your Installer class is there) then you can use Assembly.GetExecutingAssembly().Location
to get the current exe - and just trim, use Path.
to get the name of the file - then add to target dir (here, I'm not sure if its' loaded at the 'target' or I'm thinking not). Then check for, whether that exists (basically you could do that on Install not AfterInstall as you know it'll be there) - NSGaga 2012-04-06 00:08