def build_function(target, source, env): nsi = str(source[0]) env.Replace(package = str(target[0])) tmp = nsi + '.tmp' input = None output = None try: input = open(nsi, 'r') output = open(tmp, 'w') output.write(input.read() % env) finally: if input is not None: input.close() if output is not None: output.close() action = CommandAction('$NSISCOM $NSISOPTS ' + tmp) ret = action.execute(target, [tmp], env) if ret != 0: return ret if env.get('code_sign_key', None): cmd = '"$SIGNTOOL" sign /f "%s"' % env.get('code_sign_key') if 'code_sign_key_pass' in env: cmd += ' /p "%s"' % env.get('code_sign_key_pass') if 'summary' in env: cmd += ' /d "%s"' % env.get('summary') if 'url' in env: cmd += ' /du "%s"' % env.get('url') if 'timestamp_url' in env: cmd += ' /t "%s"' % env.get('timestamp_url') cmd += ' $TARGET' action = CommandAction(cmd) return action.execute(target, [], env) return 0
def build_function(target, source, env): nsi = str(source[0]) install_files = env.get('nsis_install_files', []) # Find DLLs if 'nsi_dll_deps' in env: for path in env.FindDLLs(env.get('nsi_dll_deps')): install_files += [path] # Install files files = '\n' for path in install_files: if os.path.isdir(path): files += ' SetOutPath "$INSTDIR\\%s"\n' % os.path.basename(path) files += ' File /r "%s\\*.*"\n' % path files += ' SetOutPath "$INSTDIR"\n' else: files += ' File "%s"\n' % path env['NSIS_INSTALL_FILES'] = files # Set package name env.Replace(package=str(target[0])) if not 'PACKAGE_ARCH' in env: import platform env['PACKAGE_ARCH'] = platform.architecture()[0][:2] tmp = nsi + '.tmp' input = None output = None try: input = open(nsi, 'r') output = open(tmp, 'w') output.write(input.read() % env) finally: if input is not None: input.close() if output is not None: output.close() action = CommandAction('$NSISCOM $NSISOPTS ' + tmp) ret = action.execute(target, [tmp], env) if ret != 0: return ret if env.get('code_sign_key', None): cmd = '"$SIGNTOOL" sign /f "%s"' % env.get('code_sign_key') if 'code_sign_key_pass' in env: cmd += ' /p "%s"' % env.get('code_sign_key_pass') if 'summary' in env: cmd += ' /d "%s"' % env.get('summary') if 'url' in env: cmd += ' /du "%s"' % env.get('url') if 'timestamp_url' in env: cmd += ' /t "%s"' % env.get('timestamp_url') cmd += ' $TARGET' action = CommandAction(cmd) return action.execute(target, [], env) return 0
def build_function(target, source, env): nsi = str(source[0]) install_files = env.get('nsis_install_files', []) # Find DLLs if 'nsi_dll_deps' in env: for path in env.FindDLLs(env.get('nsi_dll_deps')): install_files += [path] # Install files files = '\n' for path in install_files: if os.path.isdir(path): files += ' SetOutPath "$INSTDIR\\%s"\n' % os.path.basename(path) files += ' File /r "%s\\*.*"\n' % path files += ' SetOutPath "$INSTDIR"\n' else: files += ' File "%s"\n' % path env['NSIS_INSTALL_FILES'] = files # Set package name env.Replace(package = str(target[0])) if not 'PACKAGE_ARCH' in env: import platform env['PACKAGE_ARCH'] = platform.architecture()[0][:2] tmp = nsi + '.tmp' input = None output = None try: input = open(nsi, 'r') output = open(tmp, 'w') output.write(input.read() % env) finally: if input is not None: input.close() if output is not None: output.close() action = CommandAction('$NSISCOM $NSISOPTS ' + tmp) ret = action.execute(target, [tmp], env) if ret != 0: return ret if env.get('code_sign_key', None): cmd = '"$SIGNTOOL" sign /f "%s"' % env.get('code_sign_key') if 'code_sign_key_pass' in env: cmd += ' /p "%s"' % env.get('code_sign_key_pass') if 'summary' in env: cmd += ' /d "%s"' % env.get('summary') if 'url' in env: cmd += ' /du "%s"' % env.get('url') if 'timestamp_url' in env: cmd += ' /t "%s"' % env.get('timestamp_url') cmd += ' $TARGET' action = CommandAction(cmd) return action.execute(target, [], env) return 0
def build_function(target, source, env): top = source[0] if 1 < len(source): extra = ' -z ' + ' -z '.join(map(str, source[1:])) else: extra = '' action = CommandAction('$CXFREEZE $SOURCE --target-dir $TARGET' + extra) return action.execute(target, [top], env)
def build_function(target, source, env): nsi = str(source[0]) env.Replace(package = str(target[0])) tmp = nsi + '.tmp' input = None output = None try: input = open(nsi, 'r') output = open(tmp, 'w') output.write(input.read() % env) finally: if input is not None: input.close() if output is not None: output.close() action = CommandAction('$NSISCOM $NSISOPTS ' + tmp) return action.execute(target, [tmp], env)
def build_function(target, source, env): nsi = str(source[0]) env.Replace(package=str(target[0])) tmp = nsi + '.tmp' input = None output = None try: input = open(nsi, 'r') output = open(tmp, 'w') output.write(input.read() % env) finally: if input is not None: input.close() if output is not None: output.close() action = CommandAction('$NSISCOM $NSISOPTS ' + tmp) return action.execute(target, [tmp], env)