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