mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-13 02:08:50 +01:00
Merge pull request #316 from cuu/master
try to add a simple way to re-install the CommercialSoftwarePackage
This commit is contained in:
commit
edbcd7d47a
@ -340,6 +340,12 @@ class MyCommercialSoftwarePackage(object):
|
|||||||
def API(self,main_screen):
|
def API(self,main_screen):
|
||||||
if main_screen !=None:
|
if main_screen !=None:
|
||||||
if self._Done != "":
|
if self._Done != "":
|
||||||
|
#try to check if the installed package still there, if not ,remove the done flag file
|
||||||
|
if FileExists(os.path.join(self._ComPkgInfo["GameDir"],self._ComPkgInfo["InstallDir"] )) == False:
|
||||||
|
done_file = os.path.join( os.path.dirname(self._Done),".done")
|
||||||
|
if FileExists(done_file):
|
||||||
|
os.remove(done_file)
|
||||||
|
|
||||||
main_screen._MsgBox.SetText("Starting")
|
main_screen._MsgBox.SetText("Starting")
|
||||||
main_screen._MsgBox.Draw()
|
main_screen._MsgBox.Draw()
|
||||||
main_screen.SwapAndShow()
|
main_screen.SwapAndShow()
|
||||||
|
|||||||
@ -539,12 +539,15 @@ class MainScreen(Widget):
|
|||||||
elif self.IsCommercialPackage( os.path.join(_dir,i)):
|
elif self.IsCommercialPackage( os.path.join(_dir,i)):
|
||||||
data = None
|
data = None
|
||||||
em = MyCommercialSoftwarePackage()
|
em = MyCommercialSoftwarePackage()
|
||||||
|
|
||||||
|
with open(os.path.join(_dir,i) +"/"+commercialsoftware_flag) as f:
|
||||||
|
data = json.load(f)
|
||||||
|
|
||||||
if FileExists( _dir+"/"+i+"/.done"):
|
if FileExists( _dir+"/"+i+"/.done"):
|
||||||
print(_dir+"/"+i+"/.done")
|
print(_dir+"/"+i+"/.done")
|
||||||
em._Done = os.path.realpath(_dir+"/"+i+"/"+i2+".sh")
|
em._Done = os.path.realpath(_dir+"/"+i+"/"+i2+".sh")
|
||||||
|
em._ComPkgInfo = data
|
||||||
else:
|
else:
|
||||||
with open(os.path.join(_dir,i) +"/"+commercialsoftware_flag) as f:
|
|
||||||
data = json.load(f)
|
|
||||||
em._ComPkgInfo = data
|
em._ComPkgInfo = data
|
||||||
em._Done = ""
|
em._Done = ""
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user