Install Bug & Enhancement - Registry Entries

sainokawara

New Member
My apologies, I apparently posted this to the wrong Forum. I just wanted to make certain that someone supporting Eraser reviews them because it describes two issues that I encountered installing Eraser and what I had to do to correct them.

1) Bug => I believe the Value in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run is incorrect to Auto start Eraser.

=> I am convinced that I made a mistake in the above "diagnosis and solution". I now believe that the failure to Auto start is due to UAC restrictions about starting programs authorized to run with Administrator authority: It canNOT be done by creating an entry in HKLM\...\Run or HKCU\...\Run. However, such programs can be started by creating a Task which will be started at LOGON by the Windows Task Scheduler! It is unrealistic to expect the average user to know how to do this. But, it CAN be done by the Eraser "installer" as I have found an example of a product which does it. The important points are:

1) General - Check "Run with highest privileges" as this suppresses the UAC prompts!
2) Actions - Add the "/atRestart" option so the window does NOT open at LOGON!
Becareful, when I wrote "C:\Program Files\Eraser\Eraser.exe" /atRestart
on the line, it worked. When I tried adding the '/atRestart' as an optional parameter, it failed!
3) Conditions - Uncheck the Power options
4) Settings - Uncheck "Stop Task running longer" options

Since Tasks can be Exported/Imported, I am hopeful that it will be easy for Eraser "install" to create this Scheduler Task.

=> I hope I have redeemed myself with the above proposed solution! I have tested this on Windows 7 and it works but the system I use for Windows 8/8.1/10 just "died a horrible death" so I am unable to test on another system until I build a replacement system.

2) Enhancement => This is also probably a Bug but I will call it an enhancement. The "Scheduled Tasks" must run with Administrator authority but, as installed, they don't so they fail. When I googled it, I saw a lot of discussion about this issue. It is unrealistic to expect the average user to know how to get Eraser to run with Administrator authority. I would suggest that the install process create the following Registry Entry: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
StringValue: C:\Program Files\Eraser\Eraser.exe
DataValue: ~RUNASADMIN

On Windows 7, you have to create the following Registry Entry: HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
StringValue: C:\Program Files\Eraser\Eraser.exe
DataValue: RUNASADMIN

These corrected the two issues I was having with Eraser.
 
Last edited:
I'll look at adding these changes to the install. You have done a lot of good research here.
 
muscas, I am certain you know exactly where install stores the string to Auto start Eraser. However, for anyone doing this manually, I left out one level in my post. The correct value is:
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run". Just change the "/" to a "-" and Eraser will Auto start correctly

I double checked all my other keys/strings and they are correct. If someone is manually following these instructions, it may be necessary to first add the "Layers" key to "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags" as it is not present when Windows is first installed. If you add the string "C:\Program Files\Eraser\Eraser.exe" with the data value "~RUNASADMIN", Eraser will run with Administrator authority.

<I got another "Error Message" from this Forum so will try to save this and correct it if necessary. I only experience this problem on this Forum?>
 
muscas, it gets better! My suggestion for "HKLM\SOFTWARE\...\AppCompatFlags\Layers" works on Windows Vista and is the Microsoft recommended method on Windows 8/8.1 and probably Windows 10. See OPTION SEVEN at "eightforums<period>com/tutorials/9564-run-administrator-windows-8-a<period>html". However, it doesn't work for Windows 7. On Windows 7, you have to create the following Registry Entry: HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
StringValue: C:\Program Files\Eraser\Eraser.exe
DataValue: RUNASADMIN
withOUT the preceeding "~" that was added for the HKLM\...\Layers String's DataValue. I tested just this on Windows 7 and Eraser does run with Administrator authority with it. See the posts on "stackoverflow<period>com/questions/1726048/runasadmin-in-registry-doesnt-seem-to-work-in-windows-7". Since you need to support Windows Vista to Windows 10, you will have to create both the HKLM and the HKCU strings.

I have no interest in testing on Windows XP so you are on your own on that release. I think I have beat this dead horse so I will move along and tilt a new windmill.
 
Back
Top