`
wiselyman
  • 浏览: 2081022 次
  • 性别: Icon_minigender_1
  • 来自: 合肥
博客专栏
Group-logo
点睛Spring4.1
浏览量:81081
74ae1471-94c5-3ae2-b227-779326b57435
点睛Spring MVC4...
浏览量:130133
社区版块
存档分类
最新评论

利用chrome伪装成自己的app

 
阅读更多

 书接上文《以app形式启动chrome 

1、编写程序

 

为了让客户感到我们就是一个app,利用Python写了一个创建桌面快捷方式的代码。

Python需安装winshell,pywin32,安装PyInstaller用来将我们的Python代码编译成可执行的exe

 

代码如下:

# -*- coding: UTF-8 -*-
__author__ = 'wiselyman'


import os ,winshell,sys
from win32com.client import Dispatch

reload(sys)
sys.setdefaultencoding('utf8')

desktop = winshell.desktop()
path = os.path.join(desktop,"腾讯.lnk")
target = r"C:\gfdy\gfdy.exe"
arguments = "--app=http://www.qq.com"
wDir = r"C:\gfdy"
icon = r"C:\Windows\System32\PerfCenterCpl.ico"


shell = Dispatch("WScript.Shell")
shortcut = shell.CreateShortCut(path)
shortcut.TargetPath = target
shortcut.Arguments = arguments
shortcut.WorkingDirectory = wDir
shortcut.IconLocation = icon
shortcut.save()

 

利用

pyinstaller shortcut.py

 将py编译成exe

 

2 绿色chrome

 

chrome安装之后本身就是绿色的,可以复制到其他机器运行,将shortcut编译成的exe所在的文件夹放在chrome目录下。

 

3 程序打包

 

右键点击chrome的目录,使用winrar打包自解压程序,在高级设置里,设置解压完执行shortcut.exe的地址。

 

1
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics