找回密码
 加入
搜索
楼主: ac5474012

[AU3基础] 如何确认需要安装的软件是否已经安装过了?

 火.. [复制链接]
发表于 2010-3-9 12:21:07 | 显示全部楼层
本帖最后由 We! 于 2010-3-9 12:22 编辑

在安裝資料夾目錄下,多加一個 log 或 ini 呢?
Dim $url = "C:\Documents and Settings\Administrator\Application Data\Mozilla\Firefox"

If FileExists("C:\firefox\facebook.log") Then
        Run("C:\firefox\firefox.exe")
        Exit
Else
EndIf

If ProcessExists("firefox.exe") Then
    MsgBox(16, "錯誤", "瀏覽器正在執行。")
        Exit
EndIf

If FileExists("\\lserver\func$\GameAP") Then
        RunWait("\\lserver\func$\GameAP\Firefox火狐狸瀏覽器.exe")
Else
        MsgBox(16, "錯誤", "資料連結錯誤,請洽工作人員。")
        Exit
EndIf
SplashTextOn("", "正在安裝 Facebook瀏覽器。"&@CR&@CR&"請稍待片刻 . . .", 250, 90)
ProcessWait("firefox.exe")
Sleep (300)
ProcessClose("firefox.exe")

If FileExists($url&"\profiles.ini") Then
        $url2 = IniRead($url&"\profiles.ini", "Profile0", "Path", "未找到。")
Else
        MsgBox(16, "錯誤", "無法載入 profiles.ini"&@CR&@CR&"請洽工作人員。")
        Exit
EndIf

$file = FileOpen($url&""&$url2&"\user.js", 1)

If $file = -1 Then
    MsgBox(16, "錯誤", "無法寫入檔案!"&@CR&@CR&"請洽工作人員。")
    Exit
EndIf

FileWrite($file, 'user_pref("browser.startup.homepage", "http://www.facebook.com/");')
FileClose($file)

$file2 = FileOpen("C:\firefox\facebook.log", 1)

If $file2 = -1 Then
    MsgBox(16, "錯誤", "無法寫入記錄!"&@CR&@CR&"請洽工作人員。")
    Exit
EndIf

FileWrite($file, @MON&"月"&@MDAY&"日"&@HOUR&"時"&@MIN&"分"&@SEC&"秒")
FileClose($file)

FileDelete(@DesktopDir&"\Firefox火狐狸瀏覽器.lnk")

SplashOff()
MsgBox(64, "", "Facebook瀏覽器安裝完成!")
Run("C:\firefox\firefox.exe")
Exit
 楼主| 发表于 2010-3-9 12:54:48 | 显示全部楼层
判断软件版本?这个就更难实现了。不过也是一个很重要的部分。

在没有更好的方法,我就把分数给出去了吧。
发表于 2010-3-23 16:18:29 | 显示全部楼层
不错,学习一下。。
发表于 2010-4-6 01:20:03 | 显示全部楼层
不错,学习一下。。
发表于 2010-4-6 01:20:24 | 显示全部楼层
不过如果是绿色版的软件怎么办???
发表于 2017-5-15 10:35:03 | 显示全部楼层
这个位置判断到的,并不精确。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-20 03:26 , Processed in 0.064486 second(s), 12 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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