Help with Inno Setup registry entry

I want my program to start up when windows starts up

I added this line to my setup (inno) and it works, it adds the line to the registry, but i get a Acess Denied error. Not sure what is causing it

[Registry]
Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "Alerts_client.exe"; ValueData: "{app}\Alerts_client.exe"

If i comment this registry entry out, the error message goes away.....and of course, i dont get my registry entry.

what gives? any inno setup users out there, know if my registry entry is correct?

thanks
Looking_4_AnswersAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vadim RappCommented:
Access denied during the installation, or subsequent use?

ValueData better be [INSTALLDIR\alerts_client.exe , or even better [#filename] where filename is the value from the column "File" in the table "File" describing this file. (I'm not sure what it looks like in Innosetup).
MirtheilSoftware DeveloperCommented:
For InnoSetup, {app} is equivalent to [INSTALLDIR].  

What is your PrivilegesRequired set to in the [Setup] section?  

Based on your description, the Access Denied seems to be coming after install when the program is run.  If that's the case, what is the application doing at that point?  
Looking_4_AnswersAuthor Commented:
@mirtheil

I used the basic wizard to create my script. The only thing i added was the registry section

which you see in my question

I dont see anything in the setup that has the words privedge in it or related to it

I am still baffles as to why i got the message, yet the key and data was placed in the registry and when i turn off my computer and restart it, my app starts up on startup

yet, when i do the initial setup, the installer throws that error "Access Denied"......and i dont get it, if i comment out the registry section, so i kjnow it has to do with that, or im missing some other line in my script

thanks
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

MirtheilSoftware DeveloperCommented:
Run the setup.exe with the /LOG="install.log" and then post the contents of the log file (install.log).  
The default privileges are Admin so that's ok you don't have anything.  

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Looking_4_AnswersAuthor Commented:
im not sure i follow you....i run this from windows

Alerts_Client_Setup.exe  /LOG="install.log"  ????


I get a file not found
MirtheilSoftware DeveloperCommented:
What version of InnoSetup are you using?  
From the version I'm using (5.4.0):
/LOG
Causes Setup to create a log file in the user's TEMP directory detailing file installation and [Run] actions taken during the installation process. This can be a helpful debugging aid. For example, if you suspect a file isn't being replaced when you believe it should be (or vice versa), the log file will tell you if the file was really skipped, and why.

The log file is created with a unique name based on the current date. (It will not overwrite or append to existing files.)

The information contained in the log file is technical in nature and therefore not intended to be understandable by end users. Nor is it designed to be machine-parseable; the format of the file is subject to change without notice.

/LOG="filename"
Same as /LOG, except it allows you to specify a fixed path/filename to use for the log file. If a file with the specified name already exists it will be overwritten. If the file cannot be created, Setup will abort with an error message.


You might need to specify a full path for the filename (c:\install.log).  THen once you're install is done, you should find the install.log that was created and post it.
Looking_4_AnswersAuthor Commented:
I figured it out by running it from the MS DOS window. I did get a log file, but the log file never shows a registry entry.

I am no lobger receiving the error message.

I cleaned the registry key, i uninistalled the app, and did a clean run of the setup a number of times, and i can't seem to get a error anymore.  Interesting. I never did change anything with the script.  I did reboot earlier though.

Ummmm, i did learn something new though.....that /log thingy is nice to know...thanks!
However, nothing about the writing of a registry value shows up in the log. Even though i don't get the error anymore.

Thanks
Looking_4_AnswersAuthor Commented:
I figured it out by running it from the MS DOS window. I did get a log file, but the log file never shows a registry entry.

I am no lobger receiving the error message.

I cleaned the registry key, i uninistalled the app, and did a clean run of the setup a number of times, and i can't seem to get a error anymore.  Interesting. I never did change anything with the script.  I did reboot earlier though.

Ummmm, i did learn something new though.....that /log thingy is nice to know...thanks!
However, nothing about the writing of a registry value shows up in the log. Even though i don't get the error anymore.

Thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.