Prev Previous Post   Next Post Next
Old 31st August 2009, 21:20   #1
jweinraub
Senior Member
 
Join Date: Jan 2004
Posts: 197
Send a message via AIM to jweinraub
Partial String Match During Uninstall

How do I do a partial string match during an uninstallation routine?

We make a software product and now we have released a "viewer" version, which is a stripped down version of the main thing. Only issue is, there is one common icon on the desktop.

Typically they shouldn't co-exist, but I allow it anyway by doing something like this:

code:

Function .onInit
ReadRegStr $R0 HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\NeatoTek" \
"UninstallString"
StrCmp $R0 "" goahead
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
"NeatoTek 1.2 is already installed. $\n$\nClick `OK` to continue the \
installation of the NeatoTek 1.2 Viewer or `Cancel` to cancel this installation." \
IDOK goahead
Abort


goahead:
FunctionEnd



I adapted code from the uninstall if found before start routine actually.

But in the uninstall portion:

code:

${If} $nt == "no"
; function here
Delete "$DESKTOP\Common Icon.lnk"
${EndIf}



I originally did a global var but since uninstall is an entirely different scope that didn't work. I wanted to use the same code below, and I am sure it would work, but I rather use the Display Name part of the registry, but for some reason, our product has the version number in it, whilst it also being in Display Version. Since we have released several released already too late for that change, but I rather use Display Name on the top portion too since I have a generic version in there, i rather output the var itself reads so i dont have to keep changing this with each release.

So my question is, how do i do the strcmp on that "Foobar 500" as display name and just search for foobar. The viewer has two words followed by the number, the full version I believe has one word with the number.

Any help is appreciated. I know I wrote a lot, but I think I confused things more than necessary so I hope I didnt!

thanks!
jweinraub is offline   Reply With Quote
 
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