fazbear201 / winezeug

Automatically exported from code.google.com/p/winezeug
1 stars 0 forks source link

Safari installer #144

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There seems to be an interest in using Safari through wine, but there is a bug 
causing Safari to crash on the welcome page 
http://www.apple.com/safari/welcome/ 
(http://bugs.winehq.org/show_bug.cgi?id=21146). If you start Safari and quickly 
press stop, Safari notes that it has already started once and changes the start 
page to http://www.apple.com/startpage/ which does not crash. 

Safari then works well enough for browsing, if you limit yourself to 1 tab. 
It's of great importance to Linux-using web developers to be able to test their 
sites in Safari.

Could this be automated in some way with winetricks? Like automatically setting 
something like a firstrun "flag" in some configfile, or changing the startup 
page. 

I have checked the winetricks source, and experimented a bit with the Safari 
setup. It is MSI based but located in an exe, similar to the QuickTime 
installer. 

The latest Safari 5 setup file is located at 
http://appldnld.apple.com/Safari5/061-7138.20100607.Y7U87/SafariSetup.exe with 
SHA e56d5d79d9cfbb85ac46ac78aa497d7f3d8dbc3d (http://apple.com/safari/download 
and http://support.apple.com/kb/DL1046)

Original issue reported on code.google.com by cre...@gmail.com on 28 Jul 2010 at 8:43

GoogleCodeExporter commented 8 years ago
I'll take a look.

Original comment by austinenglish@gmail.com on 28 Jul 2010 at 3:22

GoogleCodeExporter commented 8 years ago
Looks like the welcome page is embedded in Safari.dll, so that'll be hard to 
fix.

The best idea I came up with is running Safari for the user after install, and 
going to a website (winehq.org) to avoid the crash, then killing safari after a 
few seconds. It's a bit invasive, but I don't see another way. Unfortunately, 
that doesn't work. On first run, Safari does its welcome page regardless.

I then tried running with d3d, d3d8, d3d9 and wined3d disabled, but no dice. 
Safari still crashes.

Original comment by austinenglish@gmail.com on 29 Jul 2010 at 7:11

GoogleCodeExporter commented 8 years ago
I appreciate your effort! Just an idea, would it be possible to see what files 
are changed after the first run and try to reproduce those changes on install?

Original comment by cre...@gmail.com on 29 Jul 2010 at 9:35

GoogleCodeExporter commented 8 years ago
It's possible, sure. I don't have time to do it now, and may not for a couple 
weeks, I go on vacation in a couple days.

Try it yourself, it's not hard...Something like:
$ rm -rf ~/.wine
$ wine Safari.exe # install safari
$ cp -r ~/.wine ~/.wine-preinstall
$ cd ~/.wine/drive_c/Program\ Files/Safari
$ wine Safari.exe # get past first run. May take a couple tries.

then do:
$ diff -ur ~/.wine-preinstall ~/.wine &> safari.diff

and manually inspect safari.diff for changes. If the registry changes a lot 
because of time stamps, try the same thing, but only diff drive_c, and do a 
registry dump before/after and compare it as well.

Original comment by austinenglish@gmail.com on 29 Jul 2010 at 3:48

GoogleCodeExporter commented 8 years ago
I tried your suggestion, and a file that was added on the first run was 
.wine/drive_c/users/<user>/Application Data/Apple 
Computer/Preferences/com.apple.Safari.plist which amongst other things contains 
the string "LastDisplayedWelcomePageVersionString". 

I copied the file to a .wine directory where I had only installed Safari but 
not run it, and then ran Safari, and it did not display the welcome page! I 
also tried copying the file to an empty .wine dir _before_ running 
SafariSetup.exe, and when launching Safari either directly from the setup or 
directly afterwards it does not show the welcome page, and does not crash. \o/

I guess the question now is how to get/create com.apple.Safari.plist?

Original comment by cre...@gmail.com on 30 Jul 2010 at 1:54

GoogleCodeExporter commented 8 years ago
In that file there is also by default something called 
"WebKitLocalStorageDatabasePath" with the value of 
"/drive_c/users/<user>/Application Data/Apple Computer/Safari/LocalStorage". 
That seems to be the only thing with an environment specific string. I edited 
the file with a hex editor, replacing my username with the same number of x's 
and it works. 

Simply replacing the string with sed didn't work since it's binary. Safari then 
simply disregards the file and shows the welcome page.

This might cause a problem with pages using LocalStorage, I'm not sure, I will 
have to test. Anyway, I have attached the file with the path changed to 
"/drive_c/users/xxxxxx/Application Data/Apple Computer/Safari/LocalStorage". 

Original comment by cre...@gmail.com on 30 Jul 2010 at 2:38

Attachments:

GoogleCodeExporter commented 8 years ago
Supposedly plist files are just xml files. Though it seems this one has been 
compiled or obfuscated in some way. Googling shows:
http://mblog.lib.umich.edu/sites/archives/2009/07/disable_safari_1.html
so, try this file.

Original comment by austinenglish@gmail.com on 30 Jul 2010 at 8:16

Attachments:

GoogleCodeExporter commented 8 years ago
Fixed now in SVN.

Original comment by austinenglish@gmail.com on 30 Jul 2010 at 9:47

GoogleCodeExporter commented 8 years ago
Fixed now in SVN.

Original comment by austinenglish@gmail.com on 30 Jul 2010 at 9:47

GoogleCodeExporter commented 8 years ago
Muinto obrigago por votar hugo34ism 

Original comment by m...@microsoft.pt on 6 Dec 2010 at 4:13

Attachments: