3

Can anyone give me an example of how to use python's msilib standard library module to create a msi file from a custom python module?

For example, let's say I have a custom module called cool.py with the following code

class Cool(object):
    def print_cool(self):
        print "cool"

and I want to create an msi file using msilib that will install cool.py in python's site-packages directory.

How can I do that?

2 Answers 2

5

You need to write a distutils setup script for your module, then you can do

python setup.py bdist_msi

and an msi-installer will be created for your module.

See also http://docs.python.org/distutils/apiref.html#module-distutils.command.bdist_msi

Sign up to request clarification or add additional context in comments.

Comments

0

I think there is a misunderstanding: think of MS CAB Files as archives like .zip-Files. Now it is possible to put anything in such an archive, like your cool.py. But i think you mentioned that python source, since you want it executed, otherwise just use an archiver like zip, no need to use mslib.

If i am right then you first need to convert your script into an executable using something like py2exe or pyinstaller.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.