mazin Posted July 13, 2004 Share Posted July 13, 2004 -< Winamp is no problem anymore! >-Update 1: PDF tutorial for v5.03c and similar versions. Right-click and "Save Target As...".Update 2: PDF tutorial for v2.91 and similar versions. Right-click and "Save Target As...".Update 3: Some antivirus programs disallow running scripts. So, you should run scripts before installting antivirus programs.Update 4: Should you ever get any problem, read through the following posts. You should find an answer to your question.Update 5: winamp.js is now commented. Keeping comments makes no problem.Update 6: Batch method is now much more simple. No sleep.exe! No taskkill!Update 7: Installing Winamp from %systemdrive% using RunOnceEX.Update 8: Installing Winamp from %CDROM% using RunOnceEX. By bonedaddy.Finally, we can exclude features and sub-features we don't want installed!!!This JavaScript file works for any version of Winamp, as we will see. But, the example here is for Winamp 5.03a.These are the stepsPut the following files in this directory: %systemdrive%\Install\Winamp\If your source path is different, then change those in purple inside the batch.On your unattended CD, this path is $OEM$\$1\Install\Winamp\, of course.- winamp.exe --> your installer renamed for simplicity- winamp.js --> explained below- winamp.ini --> customized, from C:\Program Files\Winamp\winamp.iniClean winamp.ini by deleting any entries that refer to paths or directories like cwd=C:\Program Files\Winamp, for example.cls@echo offECHO.ECHO Installing Winamp 5.03aecho [WinampReg]>%systemroot%\winamp.iniecho IsFirstInst=>>%systemroot%\winamp.iniecho NeedReg=>>%systemroot%\winamp.iniCD %systemdrive%\Install\Winamp\Start %systemdrive%\Install\Winamp\winamp.jssleep 60taskkill /F /IM WINAMP.EXEtaskkill /F /IM winampa.execopy %systemdrive%\Install\Winamp\Winamp.ini "%systemdrive%\Program Files\Winamp\"ECHO.ECHO Registering for the Pro VersionREG ADD HKLM\SOFTWARE\Nullsoft\Winamp /v regname /d YourName /fREG ADD HKLM\SOFTWARE\Nullsoft\Winamp /v regkey /d xxxxx-xxxxx-xxxxx-xxxxx /fexitSleep time of 60 seconds might vary according to the features installed. However, it's sufficient if you install all features. You can test it before burning to your CD.Of course, you're assumed to have sleep.exe in your system32 folder. On your unattended CD, you put it here: $OEM$\$$\System32\sleep.exeIf you exclude Winamp Agent from installation, do not add taskkill /F /IM winampa.exe to your batch.If your regname has spaces, consider adding quotes. This is an example: "Your Name".Replace the Xs with your regkey. Dashes are included, if any.You do not have to create a reg file to register Winamp for the Pro version. Your registration data is included in the batch as you saw. However, if you don't want to register for the Pro version, consider deleting the last three lines from the batch above.function getWin(win, inc){var cntr = 0;while (!WshShell.AppActivate(win)){if (cntr==12) return true;cntr++;WScript.Sleep(inc);}return true;}var WshShell = new ActiveXObject("WScript.Shell");var oExec = WshShell.Exec("winamp.exe");//name of your installerwhile (oExec.Status == 0){WScript.Sleep(2000);//time needed by installer to extract its filesgetWin("Winamp Setup", 500);//name of setup screen and time to hold itWshShell.SendKeys ("{ENTER}");//hitting Agree buttonWScript.Sleep(500);//time to wait before executing next keystrokeWshShell.SendKeys ("{TAB}");//moving tabstop to the features paneWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//highlighting Winamp AgentWScript.Sleep(500);WshShell.SendKeys (" ");//deselecting Winamp AgentWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//highlighting Winamp LibraryWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//highlighting Modern Skin SupportWScript.Sleep(500);WshShell.SendKeys (" ");//deselecting Modern Skin SupportWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//highlighting User Interface ExtensionsWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//highlighting Audio File SupportWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//highlighting Video File SupportWScript.Sleep(500);WshShell.SendKeys ("%{RIGHT}");//expanding Video File SupportWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//highlighting Nullsoft VideoWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//highlighting AVI/MPG/ASFWScript.Sleep(500);WshShell.SendKeys (" ");//deselecting AVI/MPG/ASFWScript.Sleep(500);WshShell.SendKeys ("{ENTER}");//hitting Next buttonWScript.Sleep(500);WshShell.SendKeys ("{ENTER}");//hitting Next buttonWScript.Sleep(500);WshShell.SendKeys ("{DOWN}");//highlighting Desktop IconWScript.Sleep(500);WshShell.SendKeys (" ");//deselecting Desktop IconWScript.Sleep(500);WshShell.SendKeys ("{ENTER}");//hitting Next buttonWScript.Sleep(500);WshShell.SendKeys ("{DOWN 2}");//setting Internet Connection to Not connected...WScript.Sleep(500);WshShell.SendKeys ("{ENTER}");//hitting Next buttonWScript.Sleep(500);WshShell.SendKeys ("{ENTER}");//hitting Install button}WScript.quit();Sleep time of 500 (1/2 second) is not obligatory, unless you like watching , like me.You can use 200, or more or less.Keystroke legend:Use ("{ENTER}") for hitting Next and Install buttons.Use ("{TAB}") for browsing controls of setup screens.Use ("{DOWN}") for pressing the down arrow on your keyboard.Use (" ") for deselecting a feature.Use ("%{RIGHT}") for expanding a main feature into its sub-features. Now, you see that the JS file above exclude these features:- Winamp Agent- Modern Skin Support- AVI/MPG/ASF- Desktop IconAlso, it sets Internet Connection to "Not connected to the Internet".Oh! Yes, you can modify the JS to fit your needs with the help of PDF tutorial. Link to comment Share on other sites More sharing options...
Nologic Posted July 13, 2004 Share Posted July 13, 2004 mazin -ahh good show, keep up the good work. Link to comment Share on other sites More sharing options...
mazin Posted July 13, 2004 Author Share Posted July 13, 2004 Thanks, Nologic. Link to comment Share on other sites More sharing options...
SkyyPunk Posted July 13, 2004 Share Posted July 13, 2004 so then this script could be used for many other installs then too, correct? (obviously just changing the keys passed?) or is there something about the winamp install that makes it special? Link to comment Share on other sites More sharing options...
neo_3333 Posted July 14, 2004 Share Posted July 14, 2004 Do you have to use a batchfile to use this selectable feature for winamp install? Can you use a inf file instead, mazin ? Link to comment Share on other sites More sharing options...
XtremeMaC Posted July 14, 2004 Share Posted July 14, 2004 Do you have to use a batchfile ? Can you use a inf file instead, SkyyPunk ?sorry but what does that mean? and what does it have to do with SkyyPunk, a batchfile and an inf?anyways, I, too don't see how this is helpful to ppl everyone right from the start, right from the release of winamp could write a vbs and choose the components like that. that's how I had been installing after 1 day I don't wanted it...I think u should ..... and do something more usefull with other software.. Link to comment Share on other sites More sharing options...
mazin Posted July 14, 2004 Author Share Posted July 14, 2004 so then this script could be used for many other installs then too, correct? (obviously just changing the keys passed?) or is there something about the winamp install that makes it special?You can use it with any app. The setup screens are your guide for needed keystrokes. Link to comment Share on other sites More sharing options...
bonedaddy Posted July 14, 2004 Share Posted July 14, 2004 WOW this is great! After a few pm's with mazin he figured outwhy it wouldn't work, (hint; don't install after an AntiVirus program)and I taught myself how to set it up with keystrokes it installs perfect.hint; get the latest Winamp and while installing do the keystroke thing, ifyou make a mistake, just install again, follow mazin's js till you get the hangof it. The text here is for noobs to js like myself.bonedaddy Link to comment Share on other sites More sharing options...
mazin Posted July 14, 2004 Author Share Posted July 14, 2004 Thanks, bonedaddy.Cheers! Link to comment Share on other sites More sharing options...
neo_3333 Posted July 15, 2004 Share Posted July 15, 2004 mazin,Do you have to use a batchfile to execute this selectable feature for winamp install? Can you use a inf file instead, mazin ? Link to comment Share on other sites More sharing options...
mazin Posted July 15, 2004 Author Share Posted July 15, 2004 mazin,Do you have to use a batchfile to execute this selectable feature for winamp install? Can you use a inf file instead, mazin ?Execuse me, I didn't try it. You can give it a try and see what happens.However, you should keep the same conditions as in the batch.If I were to use the RunOnceEx method, I'd do the following:1- Create winamp.cmd containing the same contents of the batch from the first post.2- Create winamp.js but increase the first sleep time from 2000 to 5000.3- Clean winamp.ini by deleting any entries that refer to paths or directories like cwd=C:\Program Files\Winamp, for example.4- Then, I put these files in this directory: %systemdrive%\Install\Winamp\- winamp.exe- winamp.js- winamp.ini- winamp.cmd5- Next, I add these lines to my RunOnceEx.cmd:REG ADD %KEY%\050 /VE /D "Winamp" /fREG ADD %KEY%\050 /V 1 /D "%systemdrive%\Install\Winamp\winamp.cmd" /fActually, I don't use RunOnceEx method. If you are familiar with inf files that are used in conjunction with RunOnceEx method, then you know how to adapt the whole process.I hope this helps. Link to comment Share on other sites More sharing options...
neo_3333 Posted July 15, 2004 Share Posted July 15, 2004 Thanks mazin,One question. How would I include the sleep function in your winamp.cmd into the inf ? Link to comment Share on other sites More sharing options...
mazin Posted July 15, 2004 Author Share Posted July 15, 2004 Thanks mazin,One question. How would I include the sleep function in your winamp.cmd into the inf ?It's already included in winamp.cmd, so you don't need to include it again in any other place.However, under RunOnceEx method, it could be "sleep 60" /f assuming you've put sleep.exe in your system32 folder or even in Windows folder. Both work.Please be aware of these lines inside the batch:echo [WinampReg]>%systemroot%\winamp.iniecho IsFirstInst=>>%systemroot%\winamp.iniecho NeedReg=>>%systemroot%\winamp.iniThey create another winamp.ini inside your Windows folder. Link to comment Share on other sites More sharing options...
prathapml Posted July 15, 2004 Share Posted July 15, 2004 @mazinchanges to be incorporated- winamp.ini --> no bothers neededIn your batch fileecho [WinampReg]>%systemroot%\winamp.iniecho IsFirstInst=0>>%systemroot%\winamp.iniecho NeedReg=0>>%systemroot%\winamp.iniYour first post has a few errors.Do have a look at the quoted corrected post, and update it.Once you finish editing the first post to how the corrected one says, do PM me (so that I can edit my own pointing-out-the-error post to blank).If you are too tired out to figure out what needs fixing, this is what was wrong:IsFirstInst=0NeedReg=0That's how it should have been.Just killing the installer after a pre-defined time may turn out bad (on slower machines) as you already say. Also, REG ADD HKLM\SOFTWARE\Nullsoft\Winamp /v regkey /t REG_SZ /d xxxxx-xxxxx-xxxxx-xxxxx /f will not work, because winamp does not store your actual key - it just puts a validation hash in the registry (like WinXP's WPA). The only way to have winamp pro registration pre-enabled is to export that key after entering your key.As for whether the correction is needed, let me say it is a *MUST*. I should know, for I was the one who evolved this idea in the first place...... Winamp 5 ProI hope you don't flame me, thinking of this as a fight to see who's superior. I'm just pointing this out, because without the corrections, the purpose of echoing winamp.ini is not served. Link to comment Share on other sites More sharing options...
mazin Posted July 15, 2004 Author Share Posted July 15, 2004 If you are too tired out to figure out what needs fixing, this is what was wrong:IsFirstInst=0NeedReg=0That's how it should have been.Well!I never saw that post. I have had the MUF document for two years now. And I got that idea from there.Plus, winamp.ini works this way. You probably haven't tried it.I won't change it because it works. I even tested it under RunOnceEX method and it worked, too.I'll post it soon for peolpe who are interested. I'll just have my dinner.Thanks alot and you're welcome.AND THE KEY WORKS THIS WAY, TOO. Try it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now