本帖最後由 rictirse 於 2014-12-24 08:34 編輯
- #cs ----------------------------------------------------------------------------
- AutoIt Version: 3.3.8.1
- Author: Dang Wang
- Script Function: DisplayFusion 4.2
- Template AutoIt script.
- #ce ----------------------------------------------------------------------------
- #Region
- #AutoIt3Wrapper_icon=C:NewDang.ico
- #AutoIt3Wrapper_Compression=5
- #AutoIt3Wrapper_Res_Comment=DisplayFusion 4.2
- #AutoIt3Wrapper_Res_Description=DisplayFusion 4.2
- #AutoIt3Wrapper_Res_Fileversion=4.2.0.0
- #AutoIt3Wrapper_Res_LegalCopyright=噹噹
- #EndRegion
- #NoTrayIcon
- #RequireAdmin
- AutoItSetOption ( "WinTitleMatchMode", 4)
- _OneOpen()
- Dim Const $FileName= "DUMeter-Install.exe"
- Dim Const $FormName = "Setup - DU Meter"
- ;------- (基於版權不公開 序號)-------
- Dim Const $IID = '';; 認證碼
- Dim Const $UserName = '';;; 授權者
- Dim Const $SerialNum = '' ;; 序號
- ;------- (1 Click;2 Check;3 UnCheck;4 SetText )-------
- Dim $Text[7][5] = [ [ "Select Setup Language", "Select the language to use during the installation:", "TNewButton1", 1, ""], _
- [ $FormName, "Welcome to the DU Meter", "TNewButton1", 1, ""], _
- [ $FormName, "Please read the following important information before continuing.", "TNewRadioButton1", 2, ""], _
- [ $FormName, "Please read the following important information before continuing.", "TNewButton2", 1, ""], _
- [ $FormName, "Where should DU Meter be installed?", "TNewButton3", 1, ""], _
- [ $FormName, "Click Finish to exit Setup.", "TNewCheckListBox1", 3, ""], _
- [ $FormName, "Click Finish to exit Setup.", "TNewButton3", 1, ""] ]
- $begin = TimerInit()
- FileInstall ( "DUMeter-Install.exe", @TempDir&""&$FileName)
- FileInstall ( "DUMeter.exe", @TempDir&"DUMeter.exe")
- FileInstall ( "DUMeterSvc.exe", @TempDir&"DUMeterSvc.exe")
- ShellExecute (@TempDir&""&$FileName)
- While 1
- For $i = 0 To UBound ( $Text, 1)-1
- Select
- Case WinExists ( $Text[$i][0], $Text[$i][1])
- If $Text[$i][3] = 1 Then
- ControlClick ( $Text[$i][0], $Text[$i][1], $Text[$i][2])
- ElseIf $Text[$i][3] = 2 Then
- ControlCommand ( $Text[$i][0], $Text[$i][1], $Text[$i][2], "Check", "")
- ElseIf $Text[$i][3] = 3 Then
- ControlCommand ( $Text[$i][0], $Text[$i][1], $Text[$i][2], "UnCheck", "")
- ElseIf $Text[$i][3] = 4 Then
- ControlSetText ( $Text[$i][0], $Text[$i][1], $Text[$i][2], $Text[$i][4])
- EndIf
- If $i = (UBound ( $Text, 1)-1) Then ExitLoop(2)
- EndSelect
- Next
- WEnd
- ProcessWait ("DUMeter.exe")
- Do
- ProcessClose ("DUMeter.exe")
- ProcessClose ("DUMeterSvc.exe")
- Until Not ProcessExists ("DUMeter.exe") And Not ProcessExists ("DUMeterSvc.exe")
- FileMove ( @TempDir&"DUMeter.exe", @ProgramFilesDir&"DU MeterDUMeter.exe", 9)
- FileMove ( @TempDir&"DUMeterSvc.exe", @ProgramFilesDir&"DU MeterDUMeterSvc.exe", 9)
- _Crack()
- $dif = TimerDiff ($begin)
- ShellExecute (@ProgramFilesDir&"DU MeterDUMeter.exe")
- MsgBox ( 0, "安裝完成", StringFormat ( "總安裝時間:%s秒", $dif/1000))
- Func _Crack()
- RegWrite('HKEY_LOCAL_MACHINESOFTWAREHagelDU MeterRegistration', 'IID', 'REG_SZ', $IID)
- RegWrite('HKEY_LOCAL_MACHINESOFTWAREHagelDU MeterRegistration', 'UserName', 'REG_SZ', $UserName)
- RegWrite('HKEY_LOCAL_MACHINESOFTWAREHagelDU MeterRegistration', 'SerialNum', 'REG_SZ', $SerialNum)
- EndFunc
- Func _OneOpen()
- Local $ProcessName = _FileNameConver (@AutoItExe)
- Local $list = ProcessList()
- Local $Cnt = 0
- For $i = 1 To $list[0][0]
- If $list[$i][0] = $ProcessName Then
- $Cnt += 1
- If $Cnt > 1 Then
- Exit
- EndIf
- EndIf
- Next
- EndFunc
- Func _FileNameConver ($FileName, $Flag = 0)
- $strtmp = StringSplit ($FileName, "");; 返回檔名
- If $Flag <> 1 Then
- $strtmp = StringSplit ( $strtmp[$strtmp[0]], ".");; 返回副檔名
- EndIf
- Return $strtmp[$strtmp[0]]
- EndFunc
複製代碼 |