Archive: Variable request and code help


Variable request and code help
I don't know what i'll do if there isn't another release of NSIS soon i'm just dying to get a new one. No just kinding i could live without, but there is one thing that would nice is to have $WINAMP and $WINAMP3 variables. I would do it my self and add it to the source and create my own but i don't know how to compile all of the source.

What i'm trying to do is convert the installer in my sig for WA3 Iconpack into an NSIS install. I have code here that you can look at


CRCCheck off
Name "WA3 Icons"
Caption 'WA3 Icons "Setup"'
BrandingText "Biff's custom install ver. 1.96"
MiscButtonText "< Go Back" "Next Step >" "I'm scared" "Close"
InstallButtonText "Do It"
DetailsButtonText "Show Me"
BGGradient 0000EE 00EE00 EE0000
InstProgressFlags smooth colored
InstallColors 50EE05 000000
OutFile "WA3_Icons.exe"
ComponentText "This Will Install Icons For WA3 Beta x"
EnabledBitmap "jarsonic-checked.bmp"
DisabledBitmap "jarsonic-unchecked.bmp"
DirText "It is perfered that you choose a place were the
files will stay safe!" "" "Look for it"
AutoCloseWindow false

Section
SetOutPath $INSTDIR
file "Installstuff\WA3Icons\file.ico"
file "Installstuff\WA3Icons\avs.ico"
file "Installstuff\WA3Icons\wal.ico"
file "Installstuff\WA3Icons\wac.ico"
SectionEnd

Section
WriteRegStr HKCR .mp1 "" Winamp3.poop
WriteRegStr HKCR .mp2 "" Winamp3.poop
WriteRegStr HKCR .mp3 "" Winamp3.poop
WriteRegStr HKCR .mpa "" Winamp3.poop
WriteRegStr HKCR Winamp3.poop "" "Winamp3 audio file"
WriteRegStr HKCR Winamp3.poop\DefaultIcon "" $INSTDIR\file.ico
WriteRegStr HKCR Winamp3.poop\shell "" Play
WriteRegStr HKCR Winamp3.poop\shell\Enqueue "" "&Enqueue in Winamp"
WriteRegStr HKCR Winamp3.poop\shell\Enqueue\command\ "" '"$WINAMP3\Studio.exe" /ADD "%1"'
SectionEnd

So you can see how it would help because no matter where they wanted to put the icons i would still have a direct of getting to studio.exe no matter where they have WA3 installed.

Not even close to being done with all of the reg keys.
But what i was looking for was a way to force the install to the WA3 dir instead of letting the user choose it and mess something up. Or there is always the option of buring it somewhere where they won't know where it went. I would much rather let them know where it is and give them fair warning what will happen if they mess.

Oh and "poop" is a temp name of the key so far i still have a long ways to go. And i'm doing this to cut down on the size of the original
install made by mc^^^^

any help or sugggestions would be greatly appriciated.

you can try and use the GetWinampInstPath function in the functions.htm file that is included with NSIS but you just have to modify the registry strip to search for
ReadRegStr $0 HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp3" \
"UninstallString"
instead of
ReadRegStr $0 HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" \
"UninstallString"


and also change the search for winamp.exe into a search for studio.exe as i described in the e-mail I've send to you, since the browser didn't allow me to post anything this morning...

Greetz,
Hendri.


So here's the complete script...

Good luck, hope this answers all questions,
greetz, Hendri.


that was stupid of me i should have researched it a little more bofore bothering you guys. But thatnx for the help Smile2Me:winamp: :up:

BTW i didn't get the e-mail you said you send so i tried to send on to my self and it didn't work and my e-mail address is correct.:eek:


OK i'm all done and i have the source here for any one who wants to look.