Archive: Change


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


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

How do you mean?

Show me what the read registry values look like.

-Stu


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.



## 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