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 steps
Put 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.ini
Clean winamp.ini by deleting any entries that refer to paths or directories like cwd=C:\Program Files\Winamp, for example.
This is your batch file said:
@echo off
ECHO.
ECHO Installing Winamp 5.03a
echo [WinampReg]>%systemroot%\winamp.ini
echo IsFirstInst=>>%systemroot%\winamp.ini
echo NeedReg=>>%systemroot%\winamp.ini
CD %systemdrive%\Install\Winamp\
Start %systemdrive%\Install\Winamp\winamp.js
sleep 60
taskkill /F /IM WINAMP.EXE
taskkill /F /IM winampa.exe
copy %systemdrive%\Install\Winamp\Winamp.ini "%systemdrive%\Program Files\Winamp\"
ECHO.
ECHO Registering for the Pro Version
REG ADD HKLM\SOFTWARE\Nullsoft\Winamp /v regname /d YourName /f
REG ADD HKLM\SOFTWARE\Nullsoft\Winamp /v regkey /d xxxxx-xxxxx-xxxxx-xxxxx /f
exit
Sleep 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.exe
If 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.
This is your winamp.js said:
{
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 installer
while (oExec.Status == 0)
{
WScript.Sleep(2000);//time needed by installer to extract its files
getWin("Winamp Setup", 500);//name of setup screen and time to hold it
WshShell.SendKeys ("{ENTER}");//hitting Agree button
WScript.Sleep(500);//time to wait before executing next keystroke
WshShell.SendKeys ("{TAB}");//moving tabstop to the features pane
WScript.Sleep(500);
WshShell.SendKeys ("{DOWN}");//highlighting Winamp Agent
WScript.Sleep(500);
WshShell.SendKeys (" ");//deselecting Winamp Agent
WScript.Sleep(500);
WshShell.SendKeys ("{DOWN}");//highlighting Winamp Library
WScript.Sleep(500);
WshShell.SendKeys ("{DOWN}");//highlighting Modern Skin Support
WScript.Sleep(500);
WshShell.SendKeys (" ");//deselecting Modern Skin Support
WScript.Sleep(500);
WshShell.SendKeys ("{DOWN}");//highlighting User Interface Extensions
WScript.Sleep(500);
WshShell.SendKeys ("{DOWN}");//highlighting Audio File Support
WScript.Sleep(500);
WshShell.SendKeys ("{DOWN}");//highlighting Video File Support
WScript.Sleep(500);
WshShell.SendKeys ("%{RIGHT}");//expanding Video File Support
WScript.Sleep(500);
WshShell.SendKeys ("{DOWN}");//highlighting Nullsoft Video
WScript.Sleep(500);
WshShell.SendKeys ("{DOWN}");//highlighting AVI/MPG/ASF
WScript.Sleep(500);
WshShell.SendKeys (" ");//deselecting AVI/MPG/ASF
WScript.Sleep(500);
WshShell.SendKeys ("{ENTER}");//hitting Next button
WScript.Sleep(500);
WshShell.SendKeys ("{ENTER}");//hitting Next button
WScript.Sleep(500);
WshShell.SendKeys ("{DOWN}");//highlighting Desktop Icon
WScript.Sleep(500);
WshShell.SendKeys (" ");//deselecting Desktop Icon
WScript.Sleep(500);
WshShell.SendKeys ("{ENTER}");//hitting Next button
WScript.Sleep(500);
WshShell.SendKeys ("{DOWN 2}");//setting Internet Connection to Not connected...
WScript.Sleep(500);
WshShell.SendKeys ("{ENTER}");//hitting Next button
WScript.Sleep(500);
WshShell.SendKeys ("{ENTER}");//hitting Install button
}
WScript.quit();
Sleep time of 500 (1/2 second) is not obligatory, unless you like watching
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 Icon
Also, 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.



Help

Back to top









