Old 10th August 2003, 05:12   #1
pure-krypton
Member
 
pure-krypton's Avatar
 
Join Date: Jul 2003
Location: Mooloolaba, Australia
Posts: 60
Change

I was just wondering if someone could re-create this code to use winamp 2.x and the winamp 3 reg strings without the "s and the .exe's

code:

ReadRegStr $R0 HKLM "Software\Pure Krypton\Winamp" "Install Location"
ReadRegStr $R1 HKLM "Software\Pure Krypton\Winamp3" "Install Location"
StrCmp $R0 "" 0 +3
StrCpy $INSTDIR $R1
Goto exit
StrCmp $R1 "" 0 +3
StrCpy $INSTDIR $R0
Goto exit

## $R0 = winamp2 instdir
## $R1 = winamp3 instdir
MessageBox MB_YESNO|MB_ICONQUESTION "Click YES to install into \
your Winamp 2.x directory.$\r$\nClick NO to install into your Winamp 3 directory." IDNO dir2
StrCpy $INSTDIR $R0
Goto exit
dir2:
StrCpy $INSTDIR $R1
exit:
FunctionEnd

pure-krypton is offline   Reply With Quote
Old 10th August 2003, 12:07   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
How do you mean?

Show me what the read registry values look like.

-Stu
Afrow UK is offline   Reply With Quote
Old 16th August 2003, 12:13   #3
pure-krypton
Member
 
pure-krypton's Avatar
 
Join Date: Jul 2003
Location: Mooloolaba, Australia
Posts: 60
WINAMP 2: UninstallString "C:\Winamp\UninstWA.exe"
WINAMP 3: UninstallString C:\Winamp3\uninst-wa3.EXE

I wanna use these strings without the .exe's and the " in the strings.
pure-krypton is offline   Reply With Quote
Old 16th August 2003, 12:40   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
code:

## Read from registry then remove all $\" (if any)
ReadRegStr $R0 HKLM "Software\Pure Krypton\Winamp" "Install Location"

StrCpy $R1 $R0 1 -1
StrCmp $R1 "$\"" 0 no_remove1
StrCpy $R0 $R0 -1
StrLen $R1 $R0
IntOp $R1 $R1 - 1
StrCpy $R0 $R0 "" -$R1
no_remove1:

## Read from registry then remove all $\" (if any)
ReadRegStr $R1 HKLM "Software\Pure Krypton\Winamp3" "Install Location"

Push $R0 ;store
StrCpy $R0 $R1 1 -1
StrCmp $R0 "$\"" 0 no_remove2
StrCpy $R1 $R1 -1
StrLen $R0 $R1
IntOp $R0 $R0 - 1
StrCpy $R1 $R1 "" -$R0
no_remove2:
Pop $R0 ;restore

## Remove .exe from end
StrCpy $R0 $R0 -4
StrCpy $R1 $R1 -4

## Check strings
StrCmp $R0 "" 0 +3
StrCpy $INSTDIR $R1
Goto exit
StrCmp $R1 "" 0 +3
StrCpy $INSTDIR $R0
Goto exit

## $R0 = winamp2 instdir
## $R1 = winamp3 instdir
MessageBox MB_YESNO|MB_ICONQUESTION "Click YES to install into \
your Winamp 2.x directory.$\r$\nClick NO to install into your Winamp 3 directory." IDNO +3
StrCpy $INSTDIR $R0
Goto exit
StrCpy $INSTDIR $R1
exit:



-Stu
Afrow UK 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