找回密码
 加入
搜索
查看: 4432|回复: 4

[系统综合] [已解决]:求助,au3编译时如何连同外部程序一起打包成exe(传上源码)

[复制链接]
发表于 2014-1-11 13:31:43 | 显示全部楼层 |阅读模式
本帖最后由 QQ386263723 于 2014-1-11 21:43 编辑

在编译的时候,如何把   网络加速器.exe ,内存管理.exe ,diskgenius.exe 这些软件打包到脚本里面,在别人的电脑上直接就可以运行脚本,就是在内存里面运行这些软件,不用另外在打包。

#region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_outfile=C:\Users\Administrator\Desktop\00.exe
#endregion ;**** 参数创建于 ACNWrapper_GUI ****
#include <Misc.au3>
Global $sTitle = '自由人制作Windows 系统优化工具'
If _Singleton($sTitle, 1) = 0 Then
        MsgBox(4096, "出错了", "本程序已经运行了一个实例!")
        WinActivate($sTitle)
        Exit
EndIf
$hGui = GUICreate($sTitle, 528, 363, -1, -1)
$Pic1 = GUICtrlCreatePic(@ScriptDir & "\ziyouren.jpg", 0, 0, 545, 65)
$Group1 = GUICtrlCreateGroup("     优化网络工具", 8, 72, 145, 297)
$Button1 = GUICtrlCreateButton("网络加速器", 40, 120, 81, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("     优化内存工具", 193, 71, 145, 297)
$Button2 = GUICtrlCreateButton("内存管理", 226, 114, 81, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("     运行磁盘工具", 378, 72, 145, 297)
$Button3 = GUICtrlCreateButton("diskgenius", 411, 116, 81, 33)
GUICtrlCreateLabel("                     特别鸣谢:afan  poiu  xiehuahere …… 等好友", 10, 350, 520, 360)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateGroup("", -99, -99, 1, 1)
DllCall('user32.dll', 'int', 'AnimateWindow', 'hwnd', $hGui, 'int', 1000, 'long', 0x40010)
GUISetState()

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case -3
                       
                        DllCall('user32.dll', 'int', 'AnimateWindow', 'hwnd', $hGui, 'int', 1000, 'long', 0x50010)
                        GUISetState()
                        Exit
                Case $Button1
                        Run(@ScriptDir & "\网络加速器.exe")
                Case $Button2
                        Run(@ScriptDir & "\内存管理.exe")
                Case $Button3
                        Run(@ScriptDir & "\diskgenius.exe")
                       
                        Exit
        EndSwitch
WEnd
发表于 2014-1-11 15:47:59 | 显示全部楼层
FileInstall ( "源文件", "目标路径" )
 楼主| 发表于 2014-1-11 20:59:39 | 显示全部楼层
本帖最后由 QQ386263723 于 2014-1-11 21:01 编辑

是这样吗?
 #region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_outfile=C:\Users\Administrator\Desktop\00.exe
#endregion ;**** 参数创建于 ACNWrapper_GUI ****
#include <Misc.au3>
Global $sTitle = '自由人制作Windows 系统优化工具'
If _Singleton($sTitle, 1) = 0 Then
        MsgBox(4096, "出错了", "本程序已经运行了一个实例!")
        WinActivate($sTitle)
        Exit
EndIf
$hGui = GUICreate($sTitle, 528, 363, -1, -1)
$Pic1 = GUICtrlCreatePic(@ScriptDir & "\ziyouren.jpg", 0, 0, 545, 65)
$Group1 = GUICtrlCreateGroup("     优化网络工具", 8, 72, 145, 297)
$Button1 = GUICtrlCreateButton("网络加速器", 40, 120, 81, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("     优化内存工具", 193, 71, 145, 297)
$Button2 = GUICtrlCreateButton("内存管理", 226, 114, 81, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("     运行磁盘工具", 378, 72, 145, 297)
$Button3 = GUICtrlCreateButton("diskgenius", 411, 116, 81, 33)
GUICtrlCreateLabel("                     特别鸣谢:afan  poiu  xiehuahere …… 等好友", 10, 350, 520, 360)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateGroup("", -99, -99, 1, 1)
DllCall('user32.dll', 'int', 'AnimateWindow', 'hwnd', $hGui, 'int', 1000, 'long', 0x40010)
GUISetState()

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case -3
                        
                        DllCall('user32.dll', 'int', 'AnimateWindow', 'hwnd', $hGui, 'int', 1000, 'long', 0x50010)
                        GUISetState()
                        Exit
                Case $Button1
                        FileInstall("c:\Program Files\网络加速器.exe", "c:\Program Files\ziyouren\网络加速器.exe", 1)
                        Run(@ScriptDir & "\网络加速器.exe")
                Case $Button2
                        FileInstall("c:\Program Files\内存管理.exe", "c:\Program Files\ziyouren\内存管理.exe", 1)
                        Run(@ScriptDir & "\内存管理.exe")
                Case $Button3
                           FileInstall("c:\Program Files\diskgenius.exe", "c:\Program Files\ziyouren\diskgenius.exe", 1)
                        Run(@ScriptDir & "\diskgenius.exe")
                        
                        Exit
       EndSwitch
WEnd
如果我要在
Run(@ScriptDir & "\网络加速器.exe")上面加一个,确定 和 取消的提示。怎么加(就是确定 就往下运行,如果 取消 就不动)
我这样加不行取消也往下运行,MsgBox(262144 + 4096 + 16, '自由人温馨提示', '是否确定,就运行,不运行就取消!')
回答时最好用代码,谢谢!
发表于 2014-1-11 21:22:51 | 显示全部楼层
修改该段
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case -3
                        DllCall('user32.dll', 'int', 'AnimateWindow', 'hwnd', $hGui, 'int', 1000, 'long', 0x50010)
                        Exit
                Case $Button1
                        If MsgBox(262144 + 1, '自由人温馨提示', '运行网络加速器,是否确定?') = 1 Then
                                FileInstall("c:\Program Files\网络加速器.exe", @TempDir & "\网络加速器.exe", 1)
                                Run(@TempDir & "\网络加速器.exe")
                        EndIf
                Case $Button2
                        If MsgBox(262144 + 1, '自由人温馨提示', '运行内存管理,是否确定?') = 1 Then
                                FileInstall("c:\Program Files\内存管理.exe", @TempDir & "\内存管理.exe", 1)
                                Run(@TempDir & "\内存管理.exe")
                        EndIf
                Case $Button3
                        If MsgBox(262144 + 1, '自由人温馨提示', '运行磁盘工具,是否确定?') = 1 Then
                                FileInstall("c:\Program Files\diskgenius.exe", @TempDir & "\diskgenius.exe", 1)
                                Run(@TempDir & "\diskgenius.exe")
                                Exit
                        EndIf
        EndSwitch
WEnd
 楼主| 发表于 2014-1-11 21:40:47 | 显示全部楼层
谢谢了!顶一下……加油我会继续努力。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-28 15:32 , Processed in 0.081324 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表