Help - Search - Members - Calendar
Full Version: Opera classic installer -
MSFN Forums > Unattended Windows Discussion & Support > Application Installs

   
Google Internet Forums Unattended CD/DVD Guide
Martin H
I personally preffer Opera storing it's profile data under it's own program folder, instead of in both '%appdata%\Opera\' and '%userprofile\Local Settings\Application Data\Opera\'.

However, only the Opera msi installer features a switch for enabling that during a silent install and i preffer to use the classic installer, as it's smaller, faster and as i'm not really a big fan of msi installers in general(they leave a copy of the installer into '%windir%\Installer\', and they copy the installer into %temp% first, before they unpack it there, and since 'msiexec.exe' still is loaded into memory for a long time after the install has ended...)

The unattended solution i then preffer, is to use 'munge.exe' from the Win2K Resource Kit, to replace the line "Multi User=1" into "Multi User=0" in '%programfiles%\Opera\operadef6.ini' after Opera has been installed.

Then when a new Opera version is released, then it's just a matter of replacing the old installer with the new one and remake the ISO, but if we instead had simply overwritten 'operadef6.ini' with a pre-modified one, then a new pre-modified one would be needed upon each new Opera update, as the Opera installer always overwrites 'operadef6.ini' with a new version...

You'll need 'munge.exe' and a file named 'replace.ini' with the following content :
CODE
"Multi User=1" "Multi User=0"

Then it's just a matter of :
CODE
start /wait Opera_950_classic_Setup.exe /s
munge replace.ini -t "%programfiles%\Opera\operadef6.ini"

Here is the first bit of my RunOnceEx.cmd which installs Opera :
CODE
@cmdow @ /hid
set key=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
reg add %key%\001 /v 1 /d "%~dpn0\Opera\Opera_950_classic_Setup.exe /s" /f
reg add %key%\001 /v 2 /d "%~dpn0\Opera\munge %~dpn0\Opera\replace.ini -t \"%programfiles%\Opera\operadef6.ini\"" /f
reg add %key%\001 /v 3 /d "xcopy %~dpn0\Opera\profile \"%programfiles%\Opera\" /ehq" /f
reg add %key%\001 /v 4 /d "xcopy %~dpn0\Opera\NPSWF32.dll \"%programfiles%\Opera\program\plugins\" /q" /f
reg add %key%\001 /v 5 /d "regedit /s %~dpn0\Opera\settings.reg" /f
[...]

I then have an Opera folder in '\$OEM$\RunOnceEx\' which includes the Opera classic installer, the munge.exe tool with it's replace.ini file, the flash player plugin(NPSWF32.dll), a reg-file with the reg-entries Opera sets upon second startup, when selecting 'OK' to make it the default browser(settings.reg), and then finally a subfolder named 'profile' which stores my Opera settings i.e. the 'profile' and 'mail' folders...

I use 'xcopy' instead of 'copy', because it by default removes the read-only attributes, which is convenient when copying from a CD on Win2k systems, as then an extra 'attrib' command isn't needed afterwards.

I personally preffer to not have a progress-window shown during the RunOnceEx install stage and just have the apps installed completely silent, so i then dosen't add any "description" fields in the RunOnceEx.cmd code and then the progress window isn't shown...

settings.reg :
CODE

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.htm]
@="Opera.HTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.html]
@="Opera.HTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.mht]
@="Opera.HTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.mhtml]
@="Opera.HTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xht]
@="Opera.HTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xhtm]
@="Opera.HTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xhtml]
@="Opera.HTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\http]
"EditFlags"=hex:02,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\http\shell\open\command]
@="\"C:\\Program Files\\Opera\\opera.exe\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\http\shell\open\ddeexec]
@="\"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\http\shell\open\ddeexec\Application]
@="Opera"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https]
"EditFlags"=hex:02,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell\open\command]
@="\"C:\\Program Files\\Opera\\opera.exe\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell\open\ddeexec]
@="\"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell\open\ddeexec\Application]
@="Opera"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Opera.HTML]
@="HTML Document"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Opera.HTML\DefaultIcon]
@="C:\\Program Files\\Opera\\opera.exe,1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Opera.HTML\shell\open\command]
@="\"C:\\Program Files\\Opera\\opera.exe\" \"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Opera.Image]
@="Image"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Opera.Image\shell\open\command]
@="\"C:\\Program Files\\Opera\\opera.exe\" \"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet]
@="Opera.exe"
Martin H
To ditch the extra replace.ini file, then i'm now gone over to using minised.exe instead of munge.exe...

minised is a sed implementation which is about 5 times faster and 70% smaller than the normal sed implementation(GNU sed), so that's why i'm using that version...

Here's the link to the win32 port of minised : http://gnuwin32.sourceforge.net/packages/minised.htm

Then it's just a matter of :
CODE
start /wait Opera_950_classic_Setup.exe /s
minised "s/Multi User=1/Multi User=0/" "%programfiles%\Opera\operadef6.ini" >"%programfiles%\Opera\operadef6.ini.tmp"
move "%programfiles%\Opera\operadef6.ini.tmp" "%programfiles%\Opera\operadef6.ini"

(The '/y' switch of 'move' isn't needed during overwrites when run from a batchfile...)

And the first part of my RunOnceEx.cmd which installs Opera :
CODE
@cmdow @ /hid
set key=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
reg add %key%\001 /v 1 /d "%~dpn0\Opera\Opera_950_classic_Setup.exe /s" /f
reg add %key%\001 /v 2 /d "cmd /c @%~dpn0\Opera\minised \"s/Multi User=1/Multi User=0/\" \"%programfiles%\Opera\operadef6.ini\" >\"%programfiles%\Opera\operadef6.ini.tmp\"" /f
reg add %key%\001 /v 3 /d "cmd /c @move \"%programfiles%\Opera\operadef6.ini.tmp\" \"%programfiles%\Opera\operadef6.ini\"" /f
reg add %key%\001 /v 4 /d "xcopy %~dpn0\Opera\profile \"%programfiles%\Opera\" /ehq" /f
reg add %key%\001 /v 5 /d "xcopy %~dpn0\Opera\NPSWF32.dll \"%programfiles%\Opera\program\plugins\" /q" /f
reg add %key%\001 /v 6 /d "regedit /s %~dpn0\Opera\settings.reg" /f
[...]

(I use 'cmd /c' in front of minised, since else redirection to another file isn't possible...)

Edit : I have now changed to using gsar instead of minised, since gsar supports in-file replacements, is a little smaller, and is implemented with a variation of the extremely fast Boyer-Moore search algorithm...

Then it's just a matter of :
CODE
start /wait Opera_950_classic_Setup.exe /s
gsar "-sMulti User=1" "-rMulti User=0" -o "%programfiles%\Opera\operadef6.ini"


And the first part of my RunOnceEx.cmd which installs Opera :
CODE
@cmdow @ /hid
set key=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
reg add %key%\001 /v 1 /d "%~dpn0\Opera\Opera_950_classic_Setup.exe /s" /f
reg add %key%\001 /v 2 /d "%~dpn0\Opera\gsar \"-sMulti User=1\" \"-rMulti User=0\" -o \"%programfiles%\Opera\operadef6.ini\"" /f
reg add %key%\001 /v 3 /d "xcopy %~dpn0\Opera\profile \"%programfiles%\Opera\" /ehq" /f
reg add %key%\001 /v 4 /d "xcopy %~dpn0\Opera\NPSWF32.dll \"%programfiles%\Opera\program\plugins\" /q" /f
reg add %key%\001 /v 5 /d "regedit /s %~dpn0\Opera\settings.reg" /f
[...]
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.