Skip to content
⌘ NSIS Forum Archive

Plugin installer for multiple programs (selectable at start)

2 posts

specy#

Plugin installer for multiple programs (selectable at start)

I have an installer that installs a plugin in a subdirectory of a program, in this case Winamp.

Since most people aren't using Winamp anymore, I want the installer to detect a number of different programs on startup and then - before anything else - ask the user for which program they want to install the plugin. (For example Winamp, SAM Broadcaster, Station Playlist, AIMP, MediaMonkey).

So basically:
1. Check which programs are installed
2. Show a drop-down list and let them pick one
3. Show the directory where that program is installed (and they can change it if they want to for some reason), so basically just run the normal installer

For just one program it's pretty easy, for example this finds the install directory for Winamp:

; The default installation directory
InstallDir $PROGRAMFILES\Winamp

; detect winamp path from uninstall string if available
InstallDirRegKey HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" \
"UninstallString"
And a bit later code like this can check whether there's actually a Winamp executable and plugins folder with files in it:


IfFileExists $INSTDIR\Winamp.exe SkipIA
IfFileExists $INSTDIR\Plugins\*.* SkipIA2
This works fine for one program (and will find it if it's installed in a non-standard directory), but I can't figure out how to do this test for multiple programs, store all the directories, and ask the user which one to install before doing anything else.
Anders#
You can't use the installdir stuff, you have to manually read from the registry yourself. Create a custom page with a dropdown and set $InstDir in the leave callback for that page.