Skip to content

Commit

Permalink
Merge pull request #24 from hass-agent/development
Browse files Browse the repository at this point in the history
Release: 2.0.0 migration null reference fix
  • Loading branch information
amadeo-alex authored Dec 23, 2023
2 parents fb51302 + 87f4d56 commit 5a85743
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/HASS.Agent.Installer/InstallerScript.iss
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Parameters: "compat_migrate"; Description: "Try to migrate configuration"; Flags: postinstall skipifsilent runascurrentuser
Filename: "{app}\{#MyAppExeName}"; Parameters: "compat_migrate"; Description: "Try to migrate configuration"; Flags: postinstall skipifsilent runascurrentuser unchecked
Filename: "{sys}\sc.exe"; Parameters: "start {#ServiceName}"; Description: "Start Satellite Service"; Flags: postinstall runhidden runascurrentuser
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: postinstall skipifsilent nowait

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,14 @@ private void MigrateRegistryConfig()
//from HKEY_CURRENT_USER\SOFTWARE\LAB02Research\HASSAgent
//to HKEY_CURRENT_USER\SOFTWARE\HASSAgent\Client"

//from HKEY_LOCAL_MACHINE\SOFTWARE\LAB02Research\HASSAgent\SatelliteService"
//to HKEY_LOCAL_MACHINE\SOFTWARE\HASSAgent\SatelliteService

var source = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\LAB02Research\HASSAgent");
var destination = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\HASSAgent\Client", true);
if(source == null)
{
Log.Information("[COMPATTASK] No source registry keys found");
return;
}

CopyRegistryKey(source, destination);
}

Expand Down

0 comments on commit 5a85743

Please sign in to comment.