Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Installer] Add partial offline installer and fix SQL update fatal error #220

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

berkut1
Copy link
Contributor

@berkut1 berkut1 commented Jan 6, 2025

Description

Starting from SolidCP version 1.4.8, the updater was broken, especially for Enterprise Server. This caused incomplete database updates and broke the IIS pool, leading to an unexplained 503 error. The issue could be fixed by restarting the server and manually running the update_db.sql.

The problem was likely caused by an empty character being accidentally added to the update_db.sql file in version 1.4.9, which broke the update process.
Fixed this issue:

System.Exception: Can't run SQL script C:\Program Files (x86)\SolidCP Installer\Tmp\setup\update_db.sql ---> System.Exception: Error executing SQL command:  ---> System.InvalidOperationException: ExecuteNonQuery: CommandText property has not been initialized
   at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at SolidCP.Setup.SqlProcess.Run()
   --- End of inner exception stack trace ---
   at SolidCP.Setup.SqlProcess.Run()
   --- End of inner exception stack trace ---
   at SolidCP.Setup.SqlProcess.Run()
   at SolidCP.Setup.ExpressInstallPage.RunSqlScript(String connectionString, String database, String fileName)
   at SolidCP.Setup.ExpressInstallPage.ExecuteSqlScript(String file)

Additionally, the option to use a partial offline mode was added. This is useful when there are corrupted files in the network (like in the case with SolidCP-EnterpriseServer-Update.zip), which prevent components from being updated over the network. The new feature allows you to add the fixed setup.dll to the *-update.zip to update without issues.

To use offline mode, you need to create an "Offline" folder in the SolidCP Installer directory, then create a folder with the version number (e.g., 1.5.1), and place the *-Update.zip files in that folder. A network connection is still required to get the version number for the update.

@berkut1
Copy link
Contributor Author

berkut1 commented Jan 7, 2025

@FuseCP-TRobinson It would also be great if you could include the updated setup.dll in all SolidCP-EnterpriseServer-Update.zip files starting from version 1.4.9. This would make it easier for users to update, especially if someone is still using the Installer for this. :)
I’ve tested it on my side, and the latest compiled setup.dll works without any issues with all versions.

@berkut1
Copy link
Contributor Author

berkut1 commented Jan 7, 2025

Added a parameter to prevent overwriting the SolidCP.Installer.exe.config file during installer updates. I think this was one of the most annoying issues :) This fix addresses situations like this: https://solidcp.com/forum/question/installer-is-not-showing-my-current-installed-solidcp/

UPD:
I found strange behavior and changed it to a different approach. Now the config file always stays, unless manually deleted. I tested the update from version 1.4.9 and 1.5.0, and the config file is no longer overwritten.

@berkut1 berkut1 changed the title Add partial offline installer and fix SQL update fatal error [Installer] Add partial offline installer and fix SQL update fatal error Jan 7, 2025
@berkut1 berkut1 marked this pull request as draft January 7, 2025 23:32
@berkut1 berkut1 marked this pull request as ready for review January 8, 2025 01:01
@FuseCP-TRobinson
Copy link
Member

@FuseCP-TRobinson It would also be great if you could include the updated setup.dll in all SolidCP-EnterpriseServer-Update.zip files starting from version 1.4.9. This would make it easier for users to update, especially if someone is still using the Installer for this. :) I’ve tested it on my side, and the latest compiled setup.dll works without any issues with all versions.

I checked this and the setup.dll should have always been provided in the SolidCP-EnterpriseServer-Update.zip. Have you seen this missing?

You can see it in the msbuild

SolidCP/SolidCP/build.xml

Lines 718 to 721 in 28ff929

<Copy SourceFiles="$(SetupBuildFolder)\setup.dll" DestinationFolder="$(EnterpriseServerInstall)\Setup" />
<Copy SourceFiles="$(SetupBuildFolder)\setup.pdb" DestinationFolder="$(EnterpriseServerInstall)\Setup" Condition="'$(BuildConfiguration)' == 'Debug'" />
<Copy SourceFiles="$(SetupBuildFolder)\setup.dll" DestinationFolder="$(EnterpriseServerUpdate)\Setup" />
<Copy SourceFiles="$(SetupBuildFolder)\setup.pdb" DestinationFolder="$(EnterpriseServerUpdate)\Setup" Condition="'$(BuildConfiguration)' == 'Debug'" />

@berkut1
Copy link
Contributor Author

berkut1 commented Jan 27, 2025

No, you misunderstood.
Currently, the archives contain a setup.dll with a bug that prevents Enterprise from being updated through the installer. My solution, which uses offline mode, allows users to utilize archives with their own setup.dll. My PR fixes this bug and optionally adds the ability to perform offline updates.

However, I strongly recommend updating the setup.dll in all SolidCP-EnterpriseServer-Update.zip archives (starting from version 1.4.9) so that users don’t have to rely on offline mode and manually update the installer. This is because it’s not obvious that the issue lies with the setup.dll in the archive and not with the installer itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants