You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
oscmd:=exec.Command("osascript", "-e", "display dialog \"The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\nIf you use Safari, you need to install it.\" buttons {\"Do not install\", \"Install the certificate for Safari\"} default button 2 with title \"Arduino Agent: Install Certificates\"")
290
-
pressed, _:=oscmd.Output()
291
-
returnstrings.Contains(string(pressed), "button returned:Install the certificate for Safari")
289
+
buttonPressed:=utilities.UserPrompt("display dialog \"The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\nIf you use Safari, you need to install it.\" buttons {\"Do not install\", \"Install the certificate for Safari\"} default button 2 with title \"Arduino Agent: Install Certificates\"")
290
+
returnstrings.Contains(string(buttonPressed), "button returned:Install the certificate for Safari")
292
291
}
293
292
294
293
// PromptExpiredCerts prompts the user to update the HTTPS certificates if they are using Safari
295
294
funcPromptExpiredCerts(certDir*paths.Path) {
296
295
ifexpired, err:=isExpired(); err!=nil {
297
296
log.Errorf("cannot check if certificates are expired something went wrong: %s", err)
298
297
} elseifexpired {
299
-
oscmd:=exec.Command("osascript", "-e", "display dialog \"The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\nYour certificate is expired or close to expiration. Do you want to update it?\" buttons {\"Do not update\", \"Update the certificate for Safari\"} default button 2 with title \"Arduino Agent: Update Certificates\"")
300
-
ifpressed, _:=oscmd.Output(); strings.Contains(string(pressed), "button returned:Update the certificate for Safari") {
298
+
buttonPressed:=utilities.UserPrompt("display dialog \"The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\nYour certificate is expired or close to expiration. Do you want to update it?\" buttons {\"Do not update\", \"Update the certificate for Safari\"} default button 2 with title \"Arduino Agent: Update Certificates\"")
299
+
ifstrings.Contains(string(buttonPressed), "button returned:Update the certificate for Safari") {
301
300
err:=UninstallCertificates()
302
301
iferr!=nil {
303
302
log.Errorf("cannot uninstall certificates something went wrong: %s", err)
// If we are updating manually from 1.2.7 to 1.3.0 we have to uninstall the old agent manually first.
179
179
// This check will inform the user if he needs to run the uninstall first
180
180
ifruntime.GOOS=="darwin"&&oldInstallExists() {
181
-
printDialog("Old agent installation of the Arduino Create Agent found, please uninstall it before launching the new one")
181
+
utilities.UserPrompt("display dialog \"Old agent installation of the Arduino Create Agent found, please uninstall it before launching the new one\" buttons \"OK\" with title \"Error\"")
0 commit comments