Jump to content

Msgbox Variable In Title?


Recommended Posts

ok first, here's my code:

#include-once

Func Install()
URLDownloadToFile("http://members.lycos.co.uk/momow/files/upd.mom", "upd.mom")
$newestFile = FileOpen("upd.mom",0)
$newest = FileReadLine($newestFile,1)
FileClose($newestFile)
FileDelete("upd.mom")
$current = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Momow","Version") 
If $current == $newest Then
MsgBox(0,"Momow SpamBot v1.0", "Vous avez la version la plus recente déjà installer")
SplashOff()
Else
$msgBox = MsgBox(4,"Momow SpamBot v1.1","Une nouvelle version de Momow SpamBot est disponible. Voulez-vous l'installer?")
If $msgBox = 6 Then


ProgressOn("Momow SpamBot v1.3","Installation de Momow SpamBot v1.1","Download de Spam.exe")
ProgressSet(0,"Download du fichier Mwspam.exe")
URLDownloadToFile("http://members.lycos.co.uk/momow/files/Spam.exe", "Spam.exe")
ProgressSet(50,"Download des fichiers de configuration")
URLDownloadToFile("http://members.lycos.co.uk/momow/files/readme.txt","readme.txt")
ProgressSet(99,"Update des registry")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Momow", "Version", "REG_SZ", $newest)
ProgressOff()

EndIf


EndIf

I would like it to display something like that:

MsgBox(0,"Momow SpamBot v($current)", "Vous avez la version la plus recente déjà installer")

Where $current would be the version from a file like lets say v1.6.9 , but if I put it like that, it displays the title of the msgbox like this:

Momow SpamBot v($current)

But I want $current to be the version, not some text. How I do it?? :D

Also Where I would place my EndFunc in that. If I place it at the end, it just shows for couple of secs then close (tryicon). If I place it before the EndIf, it does an error saying theres no EndIf func.

:huh2:

Link to comment
Share on other sites

To answer your variable question, open the help file and look at #9 of the "Frequently Asked Questions (FAQ)" page.

For you other question: EndFunc should go at the end of a Function; any If-statements in the middle must be closed with EndIf.

Now if you are showing your entire script, then simply remove the

Func Install() line. Otherwise, you will need to change your script as follows:

#include-once
Install()
Exit
Func Install()
 ;body of function goes here
EndFunc

If you want to run the function many times, then put it inside a While Loop.

Hope that helps

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...