Python API for building installer

Answered

Comments

2 comments

  • Avatar
    alejandror

    Could you let us know more information about what you are trying to achieve? Each installation of InstallBuilder includes a relaxed engine file including the allowed schema for the projects. It is located under the docs folder in the installation root. Would this work for you for you?

    0
    Comment actions Permalink
  • Avatar
    seanraby

    (adding as an answer rather than comment as comment restricts my character count)

    Ok, that's helpful to allow me to continue to generate my own python library for the model, but it may be helpful for bitrock to provide this as a feature. This is an overview of the python file I use to create my project XML:

    Create a project:

    project = BitrockStructures.BitrockProject()
    project.installerFilename = "${product_shortname}-   installer.${platform_exec_suffix}"
    project.componentsDirectory = "${product_shortname}-"+command_line_options.projectfullversion+"-componentList"
    

    etc

    Create a parameter:

    parameter_shared_or_local = BitrockChoiceParameter()
    parameter_shared_or_local.name = 'installtype'
    parameter_shared_or_local.ask = '1'
    

    Create an action with rules:

    action_sudo_local_warning = createaction_msgbox("The installer cannot run as sudo for a local install.", "error")
    action_sudo_local_warning.ruleList.append(rulegroup_platform_unix)
    action_sudo_local_warning.ruleList.append(createrule_isroot())
    action_sudo_local_warning.ruleList.append(createrule_checkinstalltype("local"))
    parameter_shared_or_local.validationActionList.append(action_sudo_local_warning)
    

    Output to XML:

    xml = project.to_xml()
    fh = open(xmlfilename, 'w')
    fh.write(xmlprettify(xml))
    fh.close
    
    0
    Comment actions Permalink

Please sign in to leave a comment.