Wrye Mash Launcher

Post » Fri Sep 03, 2010 11:45 pm

Ok, so Wrye Mash is a pain to setup. Although everyone who rtfm can usally give it a good go, it is a difficult, non standard and hard for people without technical skills

This propsed patch should add WryeMash.pyw (code below). The pyw extension is registered when python is installed to start python without a console. So to start WryeMash, all a user would have to do is double click on the new file. The patch shouldn't replace mash.py for compatibility reasons.

Changes between mash.py and the new file
  • A ot more error checking - It attempts to give a messagebox error if wxpython is not installed etc
  • Automatic logging. Everything that is written to stderr (the error output stream) and stdout is now written to a file as well as the output stream
  • The python install does the same thing as the shortcut which makes messing arround with the shortcut uneeded



This has the following advantages:
  • Installing and running becomes easier. Extract to the Morrowind dir and double click on the file called Wrye Mash sums it up.
  • Users debugging their own errors becomes eaiser. The most commen errors are caught and a messagebox is given. This removes the need for them to look at a scary stack traces
  • Getting a bugdump no longer requires use of the terminal. Everything is in WryeMash.log


Is anyone able to give it a try before I see if Wrye can include it. Just copy the text below into a new file called anythingyouwant.pyw (Make sure you uncheck "Hide extensions of known types" in the windows explorer options).
#Copyright (c) 2009 Jacob Essix#Permission is hereby granted, free of charge, to any person obtaining a copy#of this software and associated documentation files (the "Software"), to deal#in the Software without restriction, including without limitation the rights#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell#copies of the Software, and to permit persons to whom the Software is#furnished to do so, subject to the following conditions:#The above copyright notice and this permission notice shall be included in#all copies or substantial portions of the Software.#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN#THE SOFTWARE.import sys, osclass ErrorLogger:	def __init__(self, f, df):		self.file = f		self.defaultStream = df	def write(self, string):		f.write(string)		self.defaultStream.write(string)def wxMessageBox(caption, message):  	app = wx.App()	dlg = wx.MessageDialog(None, message, caption, wx.OK | wx.ICON_ERROR)	dlg.ShowModal()	dlg.Destroy()	app.Destroy()#redirect stdout and stderr to a filef = file("WryeMash.log", "w+")sys.stdout = ErrorLogger(f, sys.__stdout__)sys.stderr = ErrorLogger(f, sys.__stderr__)print "Wrye Mash Log!"#check for wxtry:   import wxexcept ImportError:	try:  #the default win install comes with Tkinter iirc...		from Tkinter import *		import tkMessageBox		tk = Tk()		tk.withdraw() #hide the main window		tkMessageBox.showwarning("wxPython Not Found!", "You need to install wxPython. See the Wrye Mash readme for more info")		tk.destroy()		sys.exit(1)	except ImportError:		print "You need to install wxPython. See the Wrye Mash readme for more info!"		raise #dump the info to sdterr#--Force wxversion for Python 2.4if sys.version[:3] == '2.4':	import wxversion	wxversion.select("2.5.3.1")try:	import masherexcept ImportError:	wxMessageBox("masher not found", "masher.py was not found. This file may be installed incorrectly. It must go in the same directory as Wrye Mash")	raise# Main ------------------------------------------------------------------------if __name__ == '__main__':	if not os.path.exists("../Morrowind.exe"):		wxMessageBox("Incorrect install directory", "Wrye Mash cannot find ../Morrowind.exe. Wrye Mash must be installed to Morrowind/Mopy")		sys.exit(1)	masher.InitSettings()	masher.InitLinks()	masher.InitImages()	app = masher.MashApp(0)	app.MainLoop()

User avatar
Natalie Harvey
 
Posts: 3433
Joined: Fri Aug 18, 2006 12:15 pm

Post » Fri Sep 03, 2010 11:02 am

Tested it out - getting this error:

Wrye Mash Log!Traceback (most recent call last):  File "C:\Games\Elder Scrolls III\Morrowind\Mopy\Wrye Mash.pyw", line 91, in <module>	masher.InitImages()  File "C:\Games\Elder Scrolls III\Morrowind\Mopy\masher.py", line 6526, in InitImages	images['save.on'] = Image(r'images\save_on.png',wx.BITMAP_TYPE_PNG)  File "C:\Games\Elder Scrolls III\Morrowind\Mopy\balt.py", line 132, in __init__	raise ArgumentError(_("Missing resource file: %s.") % (self.file,))bolt.ArgumentError: Missing resource file: bolt.Path('images\\save_on.png').

Looks like it's parsing thru the script correctly, just not getting the mopy working directory to pass to mash correctly.

Fixed it by adding:
os.chdir("mopy")
after check for Morrowind.exe.
;)

----------------------------------------
Test bed:
Running the pyw file from 'C:\Games\Elder Scrolls III\Morrowind\Mopy'.
Directory structure 'C:\Games\Elder Scrolls III\Morrowind\Mopy\images' exists, as does 'save_on.png'.

Running from the normal Wrye Mash shortcut works fine.

Wrye Mash 84
Python 2.5.2
Python 2.5 comtypes-0.6.0
wxPython v2.8.7.1 (ansi) for Python 2.5

WinXP32 sp3


[edit] Oops. Just noticed your edit Yacoby - the revised script as you have it now works fine. :) :thumbsup:
User avatar
Maria Garcia
 
Posts: 3358
Joined: Sat Jul 01, 2006 6:59 am

Post » Fri Sep 03, 2010 3:12 pm

[edit] Oops. Just noticed your edit Yacoby - the revised script as you have it now works fine. :) :thumbsup:

Yeah, sorry, I was unning a version a couple of versions old (well, quite a few more than a couple)

Thanks for giving it a test :)
User avatar
Georgine Lee
 
Posts: 3353
Joined: Wed Oct 04, 2006 11:50 am

Post » Fri Sep 03, 2010 2:53 pm

Works fine here too, good stuff :thumbsup:
User avatar
Eric Hayes
 
Posts: 3392
Joined: Mon Oct 29, 2007 1:57 am

Post » Fri Sep 03, 2010 1:46 pm

Tried this out, and got this error:

Wrye Mash Log!
Traceback (most recent call last):
File "G:\Program Files\Bethesda Softworks\Morrowind\Yacoby's Wrye Mash Patch.pyw", line 66, in ?
wxversion.select("2.5.3.1")
File "C:\Python24\lib\site-packages\wxversion.py", line 112, in select
raise VersionError("wxversion.select() must be called before wxPython is imported")
wxversion.VersionError: wxversion.select() must be called before wxPython is imported

It's quite probably me, since I really don't know what I'm doing; please help?
User avatar
Davorah Katz
 
Posts: 3468
Joined: Fri Dec 22, 2006 12:57 pm

Post » Fri Sep 03, 2010 11:50 pm

Tried this out, and got this error:

Wrye Mash Log!
Traceback (most recent call last):
File "G:\Program Files\Bethesda Softworks\Morrowind\Yacoby's Wrye Mash Patch.pyw", line 66, in ?
wxversion.select("2.5.3.1")
File "C:\Python24\lib\site-packages\wxversion.py", line 112, in select
raise VersionError("wxversion.select() must be called before wxPython is imported")
wxversion.VersionError: wxversion.select() must be called before wxPython is imported

It's quite probably me, since I really don't know what I'm doing; please help?


Ok this is a wild guess from me, but are you running Python 2.4 version ? It should be version 2.5 ! Here is the website for http://www.python.org/.
User avatar
Frank Firefly
 
Posts: 3429
Joined: Sun Aug 19, 2007 9:34 am

Post » Fri Sep 03, 2010 3:21 pm

Wrong Topic. :facepalm:
Man... how I fail. :rofl:
User avatar
scorpion972
 
Posts: 3515
Joined: Fri Mar 16, 2007 11:20 am


Return to III - Morrowind