Skip to content

Commit

Permalink
fix: auto run not effective when reinstall
Browse files Browse the repository at this point in the history
  • Loading branch information
emako committed Aug 4, 2024
1 parent 9ce1421 commit 60681e9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions build/MicaSetup/Helper/Setup/InstallHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,16 @@ public static void Install(Stream archiveStream, Action<double, string> progress
}
}

try
{
RegistyAutoRunHelper.SetEnabled(Option.Current.IsCreateAsAutoRun, Option.Current.KeyName, $"{Path.Combine(Option.Current.InstallLocation, Option.Current.ExeName)} {Option.Current.AutoRunLaunchCommand}");
}
catch (Exception e)
if (Option.Current.IsCreateAsAutoRun)
{
Logger.Error(e);
try
{
RegistyAutoRunHelper.Enable(Option.Current.KeyName, $"{Path.Combine(Option.Current.InstallLocation, Option.Current.ExeName)} {Option.Current.AutoRunLaunchCommand}");
}
catch (Exception e)
{
Logger.Error(e);
}
}

if (Option.Current.IsCreateQuickLaunch)
Expand Down

0 comments on commit 60681e9

Please sign in to comment.