• Announcements

    • xper

      MSFN Sponsorship and AdBlockers!   07/10/2016

      Dear members, MSFN is made available via subscriptions, donations and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, become a site sponsor and ads will be disabled automatically and by subscribing you get other sponsor benefits.
Sign in to follow this  
Followers 0
Martin H

Opera classic installer -

3 posts in this topic

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 :


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"

Edited by Martin H
0

Share this post


Link to post
Share on other sites

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 :

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 :

@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 :

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 :

@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
[...]

Edited by Martin H
0

Share this post


Link to post
Share on other sites

I have just changed to using INFs instead of CMD/REG-files for installing my apps and regtweaks from RunOnceEx, and so during my investigations of the INF syntax at the MSDN site, then i noticed that there also was a function for making changes to INI-files, so instead of using a third-party utility like GSAR.EXE, then i've made an INF that will change 'Multi User=1' to 'Multi User=0' in operadef6.ini:

[Version]
Signature=$CHICAGO$

[DefaultInstall]
UpdateInis=Opera

[Opera]
"%16422%\Opera\operadef6.ini",System,"Multi User=1","Multi User=0"

You can install the INF by using this command:

RunDll32.exe AdvPack.Dll,LaunchINFSection opera.inf,DefaultInstall

0

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.