Jump to content
sdynk02

An Error After Compling

Recommended Posts

sdynk02

I got a problem like i wrote on Title. 
Actually, im coding a Update Version script. Everything is fine until i compile it from .au3 to .exe. FileCopy was not working. 

Here is my Code : 

Func _Update()
Local $2 = FileRead("Z:\MVT\Version.txt")
If _VersionCompare($ThisVersion, $2 ) = -1 Then
If MsgBox(32 + 4 + 262144, "Update", "Do you want to update?") = 6 Then
Sleep(100)
FileCopy("Z:\MVT\MVT-Tool.exe", @DesktopDir & "\", $FC_OVERWRITE)
Sleep(500)
MsgBox(0,"Update","Successful")
Sleep(50)
WinClose("MVT-Tool")
Sleep(50)
EndIf

Else
MsgBox(64 + 262144, "Update", "No need to update")
Sleep(10)
EndIf
EndFunc ;==> _Update

I don't know why. When it's on .au3 file, filecopy works correctly but when it's converted to .exe, function Filecopy didn't work.
Plz help me. Tks a lot  

Share this post


Link to post
Share on other sites
TheDcoder

Please disable your AV & try it, TD :)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
water

Maybe @DesktopDir & "\Z:\MVT\MVT-Tool.exe" is already opened or running?
What is the path and name of the compiled exe you are running?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
sdynk02

Please disable your AV & try it, TD :)

​I'm sorry but what's AV ? :(

Share this post


Link to post
Share on other sites
sdynk02

Maybe @DesktopDir & "\Z:\MVT\MVT-Tool.exe" is already opened or running?
What is the path and name of the compiled exe you are running?

​Just Complied exe to desktop and i tested those cases, @DesktopDir & "\Z:\MVT\MVT-Tool.exe" is already opened and running. It didn't work at all

 

Edited by sdynk02

Share this post


Link to post
Share on other sites
water

AV stands for Anti Virus.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

​Just Complied exe to desktop. 

​And the name of the compiled program is?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
sdynk02

@water : same name. MVT-Tool.exe

 

Share this post


Link to post
Share on other sites
sdynk02

@TheDcoder : I don't think so. I tested on 3 computers and what i got is..... Still didn't work

Share this post


Link to post
Share on other sites
TheDcoder

@sdynk02 Did you try with your AV disabled on your computer :)?


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
sdynk02

If possible, you guys can access to my computer through Teamview to see how it works

Share this post


Link to post
Share on other sites
water

You can't replace a program (exe) while it is running.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
sdynk02

You can't replace a program (exe) while it is running.

​@water : so do you have any ideas to make it change ???? 

Share this post


Link to post
Share on other sites
water

Yes, please have a look at _SelfUpdate


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
TheDcoder

​@water : so do you have any ideas to make it change ???? 

RunWait(@ComSpec & " /c " & 'taskkill /im "MVT-Tool.exe /f"')

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
water

But that's brute force ...


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
sdynk02

It's so complicated. I'm gonna read it later but now i think i will convert it to .a3x then. But if a computer with no AutoITv3 installed, Can it run file .a3x ? 

Share this post


Link to post
Share on other sites
TheDcoder

@sdynk02 Hey, just one question

Q: Does your file run when its not compiled?

And answer for your question: a3x file requires autoit3.exe to get executed :)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
water

A simpler method can be found here:


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×