3 from shutil
import copytree
, copy2
, move
, rmtree
7 build_dir
= sys
.argv
[1]
9 creator_dir
= os
.path
.join(build_dir
, 'workdir/installation/MSICreatorLO')
11 def prepare_project_dir():
12 instdir
= os
.path
.join(build_dir
, 'instdir')
13 fonts_dir
= os
.path
.join(instdir
, 'share/fonts')
14 new_fonts_dir
= os
.path
.join(creator_dir
, 'libo-fonts/share/fonts')
15 main_dir
= os
.path
.join(creator_dir
, 'main')
16 src_uninstaller_icon
= os
.path
.join(src_dir
, 'icon-themes/colibre/res/mainapp_48_8.png')
17 src_ui_banner
= os
.path
.join(src_dir
, 'instsetoo_native/inc_common/windows/msi_templates/Binary/Banner.bmp')
18 src_ui_background
= os
.path
.join(src_dir
, 'instsetoo_native/inc_common/windows/msi_templates/Binary/Image_2.bmp')
19 graphics_dir
= os
.path
.join(creator_dir
, 'graphics')
20 sdk_dir
= os
.path
.join(creator_dir
, 'main/sdk')
22 move(fonts_dir
, new_fonts_dir
)
23 copytree(instdir
, main_dir
, dirs_exist_ok
=True)
24 copy2(src_uninstaller_icon
, creator_dir
)
25 os
.mkdir(graphics_dir
)
26 copy2(src_ui_banner
, graphics_dir
)
27 copy2(src_ui_background
, graphics_dir
)
29 except FileExistsError
as err
:
32 def create_creator_json():
33 lo_version
= sys
.argv
[3]
35 uninstaller_icon
= 'mainapp_48_8.png'
37 "upgrade_guid": "6f05ed48-a735-4155-ab60-e4cc98455262",
38 "version": lo_version
,
39 "product_name": lo_name
,
40 "manufacturer": "The Document Foundation",
43 "comments": "Testing a libo installer",
44 "installdir": "LibreOffice Test",
45 "startmenu_shortcut": "program/soffice.exe",
46 "desktop_shortcut": "program/soffice.exe",
47 "addremove_icon": uninstaller_icon
,
49 "AllowDowngrades": "yes",
50 "IgnoreRemoveFailure": "yes"
53 "banner": "graphics/Banner.bmp",
54 "background": "graphics/Image_2.bmp"
59 "title": "The LibreOffice Suite",
60 "description": "This is a test for the LibreOffice installer",
65 "id": "libreofficefonts",
66 "title": "The LibreOffice Fonts ",
67 "description": "This is a test for the LibreOffice Fonts",
69 "staged_dir": "libo-fonts"
74 lo_object
= json
.dumps(lo_dictionary
, indent
=4)
75 with
open(os
.path
.join(creator_dir
, 'lo.json'), 'w') as lo_json
:
76 lo_json
.write(lo_object
)
78 def generate_installer():
80 createmsi
.run(['lo.json'])
82 if __name__
== '__main__':