![]() |
#1 |
Forum King
|
Installer script
I've just finished my new installer script, I thought that maybe some of you people here might prefer this method of installing to Winamp 2 or 3 (but still not both unfortunately) to the one using those messy message boxes. This one uses the 'Install Options' menu to choose between Winamp 2 and 3 like my old script but it also autodetects the install directory.
I've used my last minipack for the example script here. Please tell me if you find any bugs! Name "Jheriko - Purely Platonic" Icon "platonic.ico" OutFile "J Platonic.exe" EnabledBitmap d:\NSIS\Contrib\two-check.bmp DisabledBitmap d:\NSIS\Contrib\two-nocheck.bmp Function .onInit StrCpy $9 0 FunctionEnd Function .onNextPage IntOp $9 $9 + 1 IntCmp $9 2 nothing Goto jump nothing: SectionGetFlags 1 $1 IntCmpU $1 2147483648 getwa2path getwa3path getwa2path getwa2path: ReadRegStr $INSTDIR HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" "UninstallString" StrCpy $INSTDIR $INSTDIR "" 1 Goto skippy getwa3path: ReadRegStr $INSTDIR HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp3" "UninstallString" skippy: StrCpy $1 $INSTDIR loopy: StrCpy $2 $INSTDIR 1 $1 StrCmp $2 "" lpdone StrCmp $2 "\" lpdone IntOp $1 $1 - 1 Goto loopy lpdone: StrCpy $INSTDIR $INSTDIR $1 jump: FunctionEnd Function .onPrevPage IntOp $9 $9 - 1 FunctionEnd DirText "Please enter your full Winamp path below." ComponentText "Please choose the version of Winamp that you wish to install to:" InstType "Winamp 2" InstType "Winamp 3" InstType /NOCUSTOM AutoCloseWindow false ShowInstDetails show Section "-" SectionIn 1 2 SectionEnd Section "PP Minipack for Winamp 2" SectionIn 1 SetOutPath "$INSTDIR\Plugins\AVS" File "D:\winamp3\wacs\data\avs\multiplier.ape" SetOutPath "$INSTDIR\Plugins\AVS\JHERiKO - Purely Platonic Minipack" File "D:\winamp3\wacs\data\avs\Jheriko - Purely Platonic Minipack\*.avs" SectionEnd Section "PP Minipack for Winamp 3" SectionIn 2 SetOutPath "$INSTDIR\wacs\data\AVS\" File "D:\winamp3\wacs\data\avs\multiplier.ape" SetOutPath "$INSTDIR\wacs\data\AVS\JHERiKO - Purely Platonic Minipack" File "D:\winamp3\wacs\data\avs\Jheriko - Purely Platonic Minipack\*.avs" SectionEnd |
![]() |
![]() |
![]() |
#2 |
Senior Member
Join Date: Aug 2002
Location: Narok<Where I live<Valhalla
Posts: 165
|
it is schweet
gj, and thx for all ur help again! |
![]() |
![]() |
![]() |
#4 |
Major Dude
Join Date: Apr 2002
Location: Ballarat, Australia
Posts: 529
|
Oh but you are, anyone who can calculate phi without iterating is obviously of a higher species. (Non-sarcasm)
|
![]() |
![]() |
![]() |
#5 |
Forum King
|
I love maths.
Okay, I'll explain how the value I use as phi is calculated in a finite manner.
Phi is the ratio of the sides of a rectangle which, when cut into a square and a remainder, gives a remainder rectangle with sides of ratio phi. So, by using areas, we can see that: 1 + 1/phi = phi or, more nicely, 1/phi = phi -1 My calculation of phi is pretty standard, all that I did was solve the definiton of phi that I explained above by rearranging it a little: 1/phi = phi - 1 1 = phi^2 - phi phi^2 - phi - 1 = 0 Using the quadratic formula and taking the postive solution (the negative one is -1/phi). There are iterative formulae which limit towards phi but, originally, phi was defined in Euclid's Elements geometrically using the ancient greek mathematics which was limited to whole numbers, fractions and the solutions to quadratic equations. I think Euclid also used phi to determine the vertices of the dodecahedron and icosahedron but I'm not sure because I haven't read all of 'The Elements' (his definitions of those shapes are right near the end) but I would think it is likely that he used the same method as I did since it is geometric rather than algebraic. The maths I've been using in my latest AVS presets is thousands of years old. ![]() |
![]() |
![]() |
![]() |
#6 |
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
Hmmm phi might be another magical math number, but unlike e or pi it's quite easy to calculate (it's not a trancendental number)
![]() Though you could say that Jheriko's method is iterative, because the traditional method of calculating square roots is an iterative algorithm that approximates the square root with a rational number of increasing precision. I learnt Jheriko's method in school too, don't see why you'd consider it to be so special. |
![]() |
![]() |
![]() |
#7 |
Major Dude
Join Date: Apr 2002
Location: Ballarat, Australia
Posts: 529
|
Well, I just never saw phi as being able to be calculated using a straight formula.
How do you get the pi in 'loge (-1) = i*pi'? Here's what I've tried. logi (-1) = 2 logi (-1) = loge (-1) / loge (i) loge (-1) = logi (-1) / logi (e) loge (-1) = 2 / logi (e) loge (-1) = loge (-1) / (loge (i) * logi (e)) loge (-1) = loge (-1) / (loge (i) * logi (e)) loge (-1) + loge (-1) = loge (i) Any suggestions? |
![]() |
![]() |
![]() |
#8 |
Forum King
|
presumably you mean loge as in natural logarithm? so you mean e^ipi=-1.
Well the easiest way to solve this one is to use the identity e^itheta = cos (theta) + isin(theta) which you can prove by expanding the series for e^x and cos(x)+isin(x) (deriving these series is another matter entirely, you can use maclaurin expansions to get the sin(x) and cos(x) series and some calculus to define e as the sum of powers/factorials, remembering that x^0=1 and 0!=1) e^x = 1+x+x^2/2!+x^3/3!+x^4/4!... cos(x)= 1-x^2/2!+x^4/4!-x^6/6!+x^8/8!... sin(x) = x-x^3/3!+x^5/5!-x^7/7!... if you add if you do e^ix you get e^ix=1+ix+(ix)^2/2!+(ix)^3/3!... using i^2=-1, i^3=-i, i^4=1, i^5=i, i^6=-1 ... =1+ix-x^2/2!-ix^3/3!+x^4/4!+ix^5/5... =(1+x^2/2!-x^4/4!...)+(ix-ix^3/3+ix^5/5...) =cos(x)+isin(x) so since cos(pi)=-1 and sin(pi)=0 e^ipi = -1 hopefully i made that understandable ![]() |
![]() |
![]() |
![]() |
#9 |
Major Dude
Join Date: Apr 2002
Location: Ballarat, Australia
Posts: 529
|
That's kinda freaky though, that the 2 most irrational numbers and a number that can only be referred to, come together to form negative unity.
|
![]() |
![]() |
![]() |
#10 |
Forum King
|
You know that the sum of two positive infinities can be negative whole numbers as well.
Integrate 1/(x^2) between 1 and -1 = 1/-1 - 1/1 = -2 Integrate between -1 and 0 or 0 and -1 and you get two values that tend to positive infinity. 10 points to someone who can explain why and 100 points to anyone who can prove that my first statement is wrong. <ooooh, i have made 2^8 posts> |
![]() |
![]() |
![]() |
#11 |
Senior Member
|
STOP, YOU'RE KILLING ME!!!
![]() |
![]() |
![]() |
![]() |
#12 |
Forum King
|
I think I will stop, all of this maths is taking away from the mega-coolness of my installer script. Which is what this thread was originally all about.
![]() |
![]() |
![]() |
![]() |
#13 |
Senior Member
Join Date: Aug 2002
Location: Narok<Where I live<Valhalla
Posts: 165
|
Yeah, i sure did like your script
( although, how many people don't have WA2 and WA3 on their systems? Winamp never did (and i dont believe they should) make an effort to erase or write over WA2 ) (i know people disagree w/ me, but i sure do like WA3 a helluva lot better than WA2) |
![]() |
![]() |
![]() |
#14 |
Forum King
|
Can I use your script for mah pack, jheriko?
<noob> How do you make icons? </noob> "guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
![]() |
![]() |
![]() |
#15 |
Senior Member
Join Date: Aug 2002
Location: Narok<Where I live<Valhalla
Posts: 165
|
well, atero, i was having that same problem
try ArtIcons and i "found" my serial for that program its the best, (make sure the icon is the right dimension, NSIS wants exact shiznet) (its 32x32x16 i beleive |
![]() |
![]() |
![]() |
#16 |
Forum King
|
Anyone can use my script, thats why I posted it here.
![]() EDIT: Atero try Icon Edit Pro, Tuggummi recommended it to me, you can get it from http://www.iconedit.com its a shareware version but is fully functional and really useful. You won't need to 'find' any serial numbers. ![]() |
![]() |
![]() |
![]() |
#18 |
Forum King
|
Im gonna wait for nsis 2 to be finished before I start using it, although I have to admit that those develpoment versions are really snazzy.
|
![]() |
![]() |
![]() |
#19 |
Forum King
|
NSIS 2 Script
I made an NSIS 2 version of the script so that if you want to use the highcolor icons you can. The changes are negligable and mainly revolve around the directory detection bit since the SectionGetFlags function has changed to a more user friendly version. I haven't implemented any of the new UI features but I'm sure that you would probably want to add them yourself. I'll probably make a new script when NSIS 2 is finished with lots of nice things like uninstallers and subsections and a splash screen and stuff.
You can add the icon tag where it was before. Name "Jheriko - 6point5 Minipack" OutFile "6point5.exe" Function .onInit StrCpy $9 0 FunctionEnd Function .onNextPage IntOp $9 $9 + 1 IntCmp $9 2 nothing Goto jump nothing: SectionGetFlags 1 $1 IntCmp $1 1 getwa3path getwa2path getwa3path getwa2path: ReadRegStr $INSTDIR HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" "UninstallString" StrCpy $INSTDIR $INSTDIR "" 1 Goto skippy getwa3path: ReadRegStr $INSTDIR HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp3" "UninstallString" skippy: StrCpy $1 $INSTDIR loopy: StrCpy $2 $INSTDIR 1 $1 StrCmp $2 "" lpdone StrCmp $2 "\" lpdone IntOp $1 $1 - 1 Goto loopy lpdone: StrCpy $INSTDIR $INSTDIR $1 jump: FunctionEnd Function .onPrevPage IntOp $9 $9 - 1 FunctionEnd DirText "Please enter your full Winamp path below." ComponentText "Please choose the version of Winamp that you wish to install to:" InstType "Winamp 2" InstType "Winamp 3" InstType /NOCUSTOM AutoCloseWindow false ShowInstDetails show Section "-" SectionIn 1 2 SectionEnd Section "6point5 for Winamp 2.x" SectionIn 1 SetOutPath "$INSTDIR\Plugins\AVS" File "D:\winamp3\wacs\data\avs\multiplier.ape" File "D:\winamp3\wacs\data\avs\convolution.ape" File "D:\winamp3\wacs\data\avs\channelshift.ape" SetOutPath "$INSTDIR\Plugins\AVS\JHERiKO - 6point5" File "D:\winamp3\wacs\data\avs\New Minipack\*.avs" SectionEnd Section "6point5 for Winamp 3.x" SectionIn 2 SetOutPath "$INSTDIR\wacs\data\AVS\" File "D:\winamp3\wacs\data\avs\multiplier.ape" File "D:\winamp3\wacs\data\avs\convolution.ape" File "D:\winamp3\wacs\data\avs\channelshift.ape" SetOutPath "$INSTDIR\wacs\data\AVS\JHERiKO - 6point5" File "D:\winamp3\wacs\data\avs\New Minipack\*.avs" SectionEnd |
![]() |
![]() |
![]() |
#20 |
Junior Member
Join Date: Nov 2002
Location: Alpha In The 0th Dimension
Posts: 20
|
??
<supernoob>how do U use the scripts?</supernoob>
|
![]() |
![]() |
![]() |
#21 |
Senior Member
|
Thanks J. I'll be using this for NDD3 and beyond.
|
![]() |
![]() |
![]() |
#22 |
Major Dude
Join Date: Feb 2002
Location: home
Posts: 1,318
|
I'm no expert, but I believe you just change this line
PHP Code:
Stoke me a clipper. I'll be back for Christmas. - Arnold Rimmer Red Dwarf |
![]() |
![]() |
![]() |
#24 |
Junior Member
Join Date: Nov 2002
Location: Alpha In The 0th Dimension
Posts: 20
|
NSIS
I have NSIS, but either it
1. installed bad, or 2. I'm a political dumbass. |
![]() |
![]() |
![]() |
#26 |
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
Jheriko: just a little question... in the script you used for your previous packs, installing for WA2 or WA3 was like choosing between different sections. However, you could only select one winamp and this had to be done through the drop-down selector at the top (install-type): you couldn't click the options themselves.
Have you fixed this yet? It really bugs me and I thought your installer was broken at first because of this. |
![]() |
![]() |
![]() |
#27 |
Forum King
|
If you take a look at the J7 installer you will (hopefully) see that you can select multiple options for both winamps and also use the checkboxes to choose which version you want. The drop-down combo box is still there for convenience.
I've also attached the script so that you can take a look at it and see how it works. (Requires latest cvs version of NSIS2) |
![]() |
![]() |
![]() |
#28 |
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
By the way, here's something that belongs here....
If you want your presets to appear in numerical order, then you have to include each separately in your script. For example, if your presets are named "Joe - 01 - Name.avs": File "c:\winamp3\wacs\data\avs\Joe's pack\Joe - 01*" File "c:\winamp3\wacs\data\avs\Joe's pack\Joe - 02*" File "c:\winamp3\wacs\data\avs\Joe's pack\Joe - 03*" File "c:\winamp3\wacs\data\avs\Joe's pack\Joe - 04*" etc. Always worked for me, and it gives a more professional touch ![]() |
![]() |
![]() |
![]() |
#29 | |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
Quote:
|
|
![]() |
![]() |
![]() |
#30 |
Senior Member
|
I believe it's the NFTS filesystem. Older versions of avs are also sorted on my computer (win xp with ntfs as filesystem).
My 98SE computer doesn't have sorting, even with NSIS beta installers. I haven't tried a winamp2 version with avs 2.6.0 on that computer though. |
![]() |
![]() |
![]() |
#31 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
i've been using ntfs as long as i can think.. and in the past the files weren't sorted
|
![]() |
![]() |
![]() |
#32 | |
Major Dude
Join Date: Feb 2002
Location: Leipzig / Germany
Posts: 859
|
Quote:
![]() Btw, thanks jheriko, this will come in handy for the hotlist 2.2 installer (saves me the "figuring out" time, grab and adjust is a lot faster ![]() |
|
![]() |
![]() |
![]() |
#33 |
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
MagicX: yes I saw the movie, really cool and awesome soundtrack...
I revived this thread for installer info though, let's keep it on topic ![]() |
![]() |
![]() |
![]() |
#34 |
Forum King
|
yathosho: yes, but what about us smart people that have gone back to 2.5? that's sort of like saying you don't need to code your installers for winamp 2.x support
![]() "guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
![]() |
![]() |
![]() |
#35 | |
Senior Member
Join Date: Nov 2002
Location: California, USA
Posts: 124
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#36 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
so you think you're smart
![]() |
![]() |
![]() |
![]() |
#37 |
Major Dude
|
great script jheriko. Keep`em coming
![]() |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|