pythondistutils安装_安装msi后的python distutils
我正在用distutilsbdist_msi命令創(chuàng)建一個(gè)msi安裝程序。在我的設(shè)置文件中,
我想在msi安裝程序包后運(yùn)行代碼,請(qǐng)幫助。。在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}
)
總結(jié)
以上是生活随笔為你收集整理的pythondistutils安装_安装msi后的python distutils的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Ryzen内存+华硕主板,打造你的电脑飞
- 下一篇: AMD处理器搭配内存条,不同型号需求大不