33from json import load
44from re import fullmatch , IGNORECASE
55
6+ compressDirList = []
7+
68
79def getPEVersion (fname ):
810 try :
@@ -66,6 +68,7 @@ def getPEVersion(fname):
6668 print (configPath , "exists, replacing..." )
6769 shutil .rmtree (configPath )
6870shutil .copytree ("../config" , configPath )
71+ compressDirList .append (dst32Dir )
6972
7073if os .path .exists (dst64Dir ) and os .path .exists (dst64Path ):
7174 print (dst64Path , "exists, replacing..." )
@@ -79,20 +82,47 @@ def getPEVersion(fname):
7982 print (configPath , "exists, replacing..." )
8083 shutil .rmtree (configPath )
8184shutil .copytree ("../config" , configPath )
85+ compressDirList .append (dst64Dir )
8286
8387# TODO: GUI+client
88+ clientList = [
89+ "official-v3.1.0" , "rrg_other-v4.13441" , "rrg_other-v4.14434" ,
90+ "rrg_other-v4.14831"
91+ ]
92+
93+
94+ def generateClient (clientName ):
95+ global compressDirList
96+ clientSrcDir = "./client/" + clientName
97+ clientDstDir = "./" + ver64 + "-win64-" + clientName
98+ clientDstGUIDir = clientDstDir + "/GUI"
99+
100+ if os .path .exists (clientDstDir ) and os .path .exists (clientDstGUIDir ):
101+ print (clientDstGUIDir , "exists, replacing..." )
102+ shutil .rmtree (clientDstGUIDir )
103+ elif not os .path .exists (clientDstDir ):
104+ print (clientDstDir , "doesn't exist, creating..." )
105+ shutil .copytree (clientSrcDir , clientDstDir )
106+ shutil .copytree (dst64Dir , clientDstGUIDir )
107+ if "official" in clientName :
108+ shutil .copyfile ("./client/GUIsettings_Official.ini" ,
109+ clientDstGUIDir + "/GUIsettings.ini" )
110+ elif "rrg" in clientName :
111+ shutil .copyfile ("./client/GUIsettings_RRG.ini" ,
112+ clientDstGUIDir + "/GUIsettings.ini" )
113+ compressDirList .append (clientDstDir )
114+
115+
116+ for cl in clientList :
117+ generateClient (cl )
84118
85119use7z = input ("Compress?(y/N)" )
86120if fullmatch ("yes|y" , use7z , IGNORECASE ):
87- archive32Path = dst32Dir + ".7z"
88- archive64Path = dst64Dir + ".7z"
89-
90- if os .path .exists (archive32Path ):
91- print (archive32Path , "exists, replacing..." )
92- os .remove (archive32Path )
93- os .system ("7z a -t7z -mmt8 -mx9 " + archive32Path + " " + dst32Dir )
94-
95- if os .path .exists (archive64Path ):
96- print (archive64Path , "exists, replacing..." )
97- os .remove (archive64Path )
98- os .system ("7z a -t7z -mmt8 -mx9 " + archive64Path + " " + dst64Dir )
121+ print (compressDirList )
122+ for it in compressDirList :
123+ archivePath = it + ".7z"
124+
125+ if os .path .exists (archivePath ):
126+ print (archivePath , "exists, replacing..." )
127+ os .remove (archivePath )
128+ os .system ("7z a -t7z -mmt8 -mx9 " + archivePath + " " + it )
0 commit comments