Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 9th March 2019, 21:34   #1
specy
Member
 
Join Date: Sep 2004
Posts: 52
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:
code:

; 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:

code:

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.

specy is offline   Reply With Quote
Old 9th March 2019, 23:36   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,263
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.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump