Safe button action (preferences 0 or 1 is the saved result of a checkbox):
If Preferences.boot = 1 Then
Call AddToStartUp(True)
Else
Call AddToStartUp(False)
End if
Then I added a method AddToStartUp:
[code] Dim Reg As RegistryItem
Reg = New RegistryItem(“HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run”)
Select Case Enabled
Case True 'Add Item
If TargetWin32 Then
Reg.Value( “myAppFilename” ) = SpecialFolder.CurrentWorkingDirectory.AbsolutePath + “myAppFilename” +".exe"
End If
Case False 'Remove Item
If TargetWin32 Then
Reg.Delete(“myAppFilename”)
End If
End Select[/code]
But the ‘helper app’ method is the only Sandboxed approved method of launching your application on login. They can be a bit funny if you don’t get it quite right, oh heck App Reviewers can be awkward to begin with
I never wanted to discourage the OP for using that method, but I still have an app rejected because the idiot reviewer still thinks my app spawns a process without the user consent. So on one hand it is the only approved method, and on the other hand the cretin at the door says it’s not kosher…
Was your application launching the process? IRC, you’re not meant to launch the helper app, simply use the security API to register it, then the OS launches the helper app at startup, which in turn launches your main application. It’s all a bit backwards, but it’s what we got.
From their report, it does seem like the helper application is running, when it technically it shouldn’t. Can you verify this using Activity monitor? If you’d like, I can take a look at the application in a couple of days for you.
On open the Helper application should follow this logic.
If not mainApplication.running then
if mainApplication.open = failed then
display a message or debug that it failed to launch the application.
end if
end if
Quit
[quote=132394:@Michel Bujardet]For Mac see http://www.vdsc.eu/files/helperapp.zip . Be aware that in the Mac App Store, reviewers may frown on such a helper.
For Windows you need to add a string to the following registry key :
My Computer\\HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run
I think there may be a problem with Valdemar’s solution under Sierra, Christophe was able to get it to work when using the solution shared in this post.