1

distutilsbdist_msiコマンドで msi インストーラーを作成しています。セットアップ ファイルで、msi がパッケージをインストールした後にコードを実行したいのですが、助けてください..

from distutils.core import setup
from distutils.command.bdist_msi import bdist_msi

import os
import shutil

STARTMENU = "C:/ProgramData/Microsoft/Windows/Start Menu/Programs/ShotExplorer"
STARTUP = "C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Startup"
LINK = r"C:\Python27\Lib\site-packages\shotexplorer\ShotExplorer.lnk"


class MyCommand(bdist_msi):
    def run(self):
        bdist_msi.run(self)

        print "Creating Start Menu Entries"
        if not os.path.exists(STARTMENU):
            os.makedirs(STARTMENU)
        shutil.copy(LINK, STARTMENU)
        shutil.copy(LINK, STARTUP)


setup(
    name = "shotexplorer",
    version = "1.0",
    description = "Tool to explore shots on isilon",
    author = "abhishek.garg",
    author_email = "abhishekgarg12@yahoo.com",
    packages = ["shotexplorer", "shotexplorer.pyHook"],
    package_data = {"":["explorer.ico","quicktime.png","ShotExplorer.lnk","pyHook/_cpyHook.pyd"]},
    include_package_data = True,
    cmdclass = {'bdist_msi':MyCommand}
    )
4

0 に答える 0