Old 21st September 2002, 17:08   #1
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
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

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 21st September 2002, 17:39   #2
Karnov
Senior Member
 
Karnov's Avatar
 
Join Date: Aug 2002
Location: Narok<Where I live<Valhalla
Posts: 165
it is schweet

gj, and thx for all ur help again!
Karnov is offline   Reply With Quote
Old 22nd September 2002, 05:21   #3
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
Thanks for the thanks, I like helping people, makes me feel all big and clever.

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 22nd September 2002, 05:35   #4
Zevensoft
Major Dude
 
Zevensoft's Avatar
 
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)
Zevensoft is offline   Reply With Quote
Old 22nd September 2002, 06:11   #5
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
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.

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 23rd September 2002, 16:10   #6
UnConeD
Whacked Moderator
 
UnConeD's Avatar
 
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.

UnConeD is offline   Reply With Quote
Old 23rd September 2002, 17:40   #7
Zevensoft
Major Dude
 
Zevensoft's Avatar
 
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?
Zevensoft is offline   Reply With Quote
Old 23rd September 2002, 18:26   #8
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
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

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 24th September 2002, 05:42   #9
Zevensoft
Major Dude
 
Zevensoft's Avatar
 
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.
Zevensoft is offline   Reply With Quote
Old 24th September 2002, 08:53   #10
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
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>

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 24th September 2002, 11:21   #11
uNDefineD
Senior Member
 
uNDefineD's Avatar
 
Join Date: Jan 2002
Location: Melbourne, Australia
Posts: 297
Send a message via ICQ to uNDefineD Send a message via AIM to uNDefineD
STOP, YOU'RE KILLING ME!!!
uNDefineD is offline   Reply With Quote
Old 24th September 2002, 11:23   #12
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
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.


-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 1st October 2002, 03:03   #13
Karnov
Senior Member
 
Karnov's Avatar
 
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)
Karnov is offline   Reply With Quote
Old 2nd October 2002, 19:11   #14
dirkdeftly
Forum King
 
dirkdeftly's Avatar
 
Join Date: Jun 2001
Location: Cydonia, Mars
Posts: 2,651
Send a message via AIM to dirkdeftly
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
dirkdeftly is offline   Reply With Quote
Old 2nd October 2002, 21:11   #15
Karnov
Senior Member
 
Karnov's Avatar
 
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
Karnov is offline   Reply With Quote
Old 2nd October 2002, 21:16   #16
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
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.

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 2nd October 2002, 23:50   #17
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
Quote:
Originally posted by Karnov
make sure the icon is the right dimension, NSIS wants exact shiznet (its 32x32x16 i beleive
that applies for the old NSIS 1.x only, NSIS 2.x supports all sizes and colors!
Yathosho is offline   Reply With Quote
Old 3rd October 2002, 12:05   #18
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
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.

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 3rd October 2002, 14:46   #19
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
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

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 20th November 2002, 21:14   #20
stoopidgenius
Junior Member
 
stoopidgenius's Avatar
 
Join Date: Nov 2002
Location: Alpha In The 0th Dimension
Posts: 20
??

<supernoob>how do U use the scripts?</supernoob>
stoopidgenius is offline   Reply With Quote
Old 20th November 2002, 22:11   #21
uNDefineD
Senior Member
 
uNDefineD's Avatar
 
Join Date: Jan 2002
Location: Melbourne, Australia
Posts: 297
Send a message via ICQ to uNDefineD Send a message via AIM to uNDefineD
Thanks J. I'll be using this for NDD3 and beyond.
uNDefineD is offline   Reply With Quote
Old 21st November 2002, 02:56   #22
Jaheckelsafar
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:
File "D:\winamp3\wacs\data\avs\New Minipack\*.avs" 
to the path of your pack and it's good.

Stoke me a clipper. I'll be back for Christmas.

- Arnold Rimmer
Red Dwarf
Jaheckelsafar is offline   Reply With Quote
Old 21st November 2002, 13:31   #23
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
stoopidgenius: you need NSIS
Yathosho is offline   Reply With Quote
Old 21st November 2002, 21:41   #24
stoopidgenius
Junior Member
 
stoopidgenius's Avatar
 
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.
stoopidgenius is offline   Reply With Quote
Old 23rd November 2002, 10:21   #25
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
Try getting NSIS2

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 23rd November 2002, 11:55   #26
UnConeD
Whacked Moderator
 
UnConeD's Avatar
 
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.

UnConeD is offline   Reply With Quote
Old 23rd November 2002, 12:46   #27
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
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)
Attached Files
File Type: txt j7.txt (3.2 KB, 276 views)

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 2nd May 2003, 14:44   #28
UnConeD
Whacked Moderator
 
UnConeD's Avatar
 
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 .

UnConeD is offline   Reply With Quote
Old 2nd May 2003, 15:13   #29
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
Quote:
Originally posted by UnConeD
If you want your presets to appear in numerical order, then you have to include each separately in your script.
this is no longer necessary since avs 2.6.0 (or is it the nsis betas that now sort files?)
Yathosho is offline   Reply With Quote
Old 2nd May 2003, 17:36   #30
skupers
Senior Member
 
skupers's Avatar
 
Join Date: Aug 2002
Location: the Netherlands
Posts: 207
Send a message via AIM to skupers
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.
skupers is offline   Reply With Quote
Old 2nd May 2003, 18:25   #31
Yathosho
Forum King
 
Yathosho's Avatar
 
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
Yathosho is offline   Reply With Quote
Old 2nd May 2003, 19:27   #32
Magic.X
Major Dude
 
Magic.X's Avatar
 
Join Date: Feb 2002
Location: Leipzig / Germany
Posts: 859
Quote:
Originally posted by UnConeD
Hmmm phi might be another magical math number
Ever watched PI - the movie?

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 )


-=[The Ultimate VJ-Tool for AVS]=-

Hotlist 2.3 developement thread (old)
Magic.X is offline   Reply With Quote
Old 2nd May 2003, 19:56   #33
UnConeD
Whacked Moderator
 
UnConeD's Avatar
 
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 (we were talking about phi btw, not pi).

UnConeD is offline   Reply With Quote
Old 4th May 2003, 03:52   #34
dirkdeftly
Forum King
 
dirkdeftly's Avatar
 
Join Date: Jun 2001
Location: Cydonia, Mars
Posts: 2,651
Send a message via AIM to dirkdeftly
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
dirkdeftly is offline   Reply With Quote
Old 4th May 2003, 04:12   #35
Wiser87
Senior Member
 
Wiser87's Avatar
 
Join Date: Nov 2002
Location: California, USA
Posts: 124
Quote:
Originally posted by Atero
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
2.5?
Wiser87 is offline   Reply With Quote
Old 4th May 2003, 10:03   #36
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
so you think you're smart
Yathosho is offline   Reply With Quote
Old 4th May 2003, 19:13   #37
Phaze1987
Major Dude
 
Phaze1987's Avatar
 
Join Date: Jan 2003
Location: Lula The Sexy Empire
Posts: 916
Send a message via ICQ to Phaze1987 Send a message via AIM to Phaze1987 Send a message via Yahoo to Phaze1987
great script jheriko. Keep`em coming
Phaze1987 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Visualizations > AVS

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