@@ -44,9 +44,9 @@ def compile_online_installer():
44
44
download7zipStandaloneConsoleVersion () # needed to unpack repositories while installing on windows
45
45
46
46
# include toolchain patch files into installer, firstly copy patch files into proper directory
47
- patchDirectoryName = re . sub ( '-win32(-sha2)?\.(exe|zip)' , '' ,
48
- packages .toolchains ['gcc-arm-none-eabi' ]['gcc-arm-none-eabi-7-2018-q2-update' ][
49
- 'windows' ]['filename' ])
47
+ patchDirectoryName = get_gcc_arm_none_eabi_name (
48
+ packages .toolchains ['gcc-arm-none-eabi' ]['gcc-arm-none-eabi-7-2018-q2-update' ][
49
+ 'windows' ]['filename' ])
50
50
shutil .copytree ('../toolchains/gcc-arm-none-eabi-patch/' + patchDirectoryName ,
51
51
'../norepo/windows/toolchainPatch/' + patchDirectoryName )
52
52
@@ -60,11 +60,11 @@ def compile_offline_installer():
60
60
components_dir = '../norepo/windows/components'
61
61
62
62
# include toolchain patch files into installer, firstly copy patch files into proper directory
63
- patchDirectoryName = re . sub ( '-win32(-sha2)?\.(exe|zip)' , '' ,
64
- packages .toolchains ['gcc-arm-none-eabi' ]['gcc-arm-none-eabi-7-2018-q2-update' ][
65
- 'windows' ]['filename' ])
63
+ patchDirectoryName = get_gcc_arm_none_eabi_name (
64
+ packages .toolchains ['gcc-arm-none-eabi' ]['gcc-arm-none-eabi-7-2018-q2-update' ][
65
+ 'windows' ]['filename' ])
66
66
dir_util .copy_tree ('../toolchains/gcc-arm-none-eabi-patch/' + patchDirectoryName ,
67
- components_dir + '/gcc_arm_none_eabi' )
67
+ components_dir + '/gcc_arm_none_eabi' )
68
68
69
69
fs .copyfile ('inno setup/microide_offline.iss' , '../norepo/windows/microide_offline.iss' )
70
70
print ("Compiling offline installer..." )
@@ -77,8 +77,8 @@ def generateWindowsProductSetup():
77
77
content = file .read ()
78
78
79
79
# gcc_arm_none_eabi = packages.toolchains['gcc-arm-none-eabi']['gcc-arm-none-eabi-7-2018-q2-update']['windows']
80
- toolchainPatch = gcc_arm_none_eabi ['installationLocation' ].replace ('{app}' , 'microideDir' ) + '/' + re . sub (
81
- '-.{5,6}-win32\.(exe|zip)' , '' , gcc_arm_none_eabi ['filename' ])
80
+ toolchainPatch = gcc_arm_none_eabi ['installationLocation' ].replace ('{app}' , 'microideDir' ) + '/' + \
81
+ get_gcc_arm_none_eabi_name ( gcc_arm_none_eabi ['filename' ])
82
82
content = content .replace ("##microideToolchainPatch##" , toolchainPatch .replace ('\\ ' , '/' ))
83
83
84
84
# clang = packages.toolchains['clang']['6.0.1']['windows']
@@ -110,8 +110,8 @@ def generateInnoSetupFile(microide_version, destination):
110
110
file .write ('#define ARM_GCC_TOOLCHAIN_FILENAME "' + gcc_arm_none_eabi ['filename' ] + '"\n ' )
111
111
file .write ('#define ARM_GCC_TOOLCHAIN_VERSION "' + gcc_arm_none_eabi ['version' ] + '"\n ' )
112
112
file .write ('#define ARM_GCC_TOOLCHAIN_SIZE ' + str (gcc_arm_none_eabi ['installation size' ]) + '\n ' )
113
- file .write ('#define ARM_GCC_TOOLCHAIN_LOCATION "' + gcc_arm_none_eabi ['installationLocation' ] + ' \\ ' + re . sub (
114
- '-win32(-sha2)?\.(exe|zip)' , '' , gcc_arm_none_eabi ['filename' ]) + '"\n ' )
113
+ file .write ('#define ARM_GCC_TOOLCHAIN_LOCATION "' + gcc_arm_none_eabi [
114
+ 'installationLocation' ] + ' \\ ' + get_gcc_arm_none_eabi_name ( gcc_arm_none_eabi ['filename' ]) + '"\n ' )
115
115
file .write ('#define ARM_GCC_TOOLCHAIN_CHECKSUM_MD5 "' + gcc_arm_none_eabi ['checksum' ]['md5' ] + '"\n ' )
116
116
file .write ('\n ' )
117
117
@@ -168,6 +168,10 @@ def generateInnoSetupFile(microide_version, destination):
168
168
file .write ('\n ' )
169
169
170
170
171
+ def get_gcc_arm_none_eabi_name (filename ):
172
+ return re .sub ('-win32(-sha2)?\.(exe|zip)' , '' , filename )
173
+
174
+
171
175
def download7zipStandaloneConsoleVersion ():
172
176
filename = '7z1604-extra.7z'
173
177
dest = '../norepo/windows'
0 commit comments