Jump to content

How to First Run


James
 Share

Recommended Posts

  • Developers

I can't seem to figure out how to do a first run.

I know how to Read & Write to .ini but this seems a bit hard.

Can anyone help please?

Secure

Edit: I should use RegRead and Write. Where should I write the key too?

If it is for running it one time per pc you use " HKLM\Software\YourSoftwareName,key

If it is for running it one time per User you use " HKCU\Software\YourSoftwareName,key

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I can't seem to figure out how to do a first run.

A "First Run"? You mean make it run when the computer starts up?

You can add your script to the startup folder, or in the registry in this key:

RegWrite('HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run', '*Script Name*', 'Reg_sz', '"' & @ScriptFullPath & '"')
Link to comment
Share on other sites

  • Moderators

You guys read ebonics well, I couldn't make heads or tails of this post.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

You guys read ebonics well, I couldn't make heads or tails of this post.

Don' you be tellin' me I be readin good... I be readin good all my life dawg.

an' don't you be acskin me fo no readin lessins neither.

:):D

Link to comment
Share on other sites

Lol..

What I want to do is, when the user first runs the program it will display a message box.

Oh, i get it, you mean like it tells whether or not its been run before?

Do something like what JdeB said, put a key in the registry.

Link to comment
Share on other sites

  • Developers

How can I tell if there is one though?

One what?

Just do a RegRead() to see if the key is there and what value it has and if not there do a regwrite()

All details are in the Helpfile .

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

What's the deal with you not reading or testing what some people suggests in their posts ?

I can remember seeing numerous times where people have told you what's wrong, but where you just

seem to ignore them completely if they haven't spelled it out for you completely. It's a matter of respect

for others and your interest in solving your problem on your own, where you sometimes seem to lack both.

Link to comment
Share on other sites

Sorry Helge. Here is what I have and it works, thanks to everyon

Func FirstRun()
    RegRead("HKEY_CURRENT_USER\Software\BetaPad\Settings", "FirstRun")
    If @error Then
        GuiCtrlSetData($DocEd1, "Welcome to BetaPad. It looks like this is your first time running BetaPad.")
        RegWrite("HKEY_CURRENT_USER\Software\BetaPad\Settings", "FirstRun", "REG_SZ", "Ranb4")
    EndIf
EndFunc
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...