Skip to content

Keep openssl.cnf on upgrade and back up a leftover one on a fresh install - #42

Merged
openssl-machine merged 7 commits into
openssl:mainfrom
quarckster:fresh-install-backs-up-leftover-config
Dec 4, 2026
Merged

openssl-machine merged 7 commits into
openssl:mainfrom
quarckster:fresh-install-backs-up-leftover-config

Conversation

@quarckster

@quarckster quarckster commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Uninstall keeps config\openssl.cnf but deletes fipsmodule.cnf, so after uninstalling a FIPS install the next install could inherit a config that includes a missing file and fail in fipsinstall (error 1722). Upgrades had the opposite problem: they overwrote the user's openssl.cnf, which also turned FIPS off.

  • Fresh install: a leftover openssl.cnf is moved to openssl.cnf.<yyyyMMdd-HHmmss>.bak, and the final page names the backup. If the file is locked, the wizard offers Retry (a silent install fails cleanly). Rollback restores the file.
  • Upgrade within a release branch: only the binaries change. The folder, the options and openssl.cnf are kept, the wizard skips the option pages, and fipsmodule.cnf is regenerated.
  • Release branches (4.0, 4.1, …) keep installing side by side, each in its own folder. The Upgrade table now matches only the installer's own branch, so the two additions above don't treat another branch as the previous or a newer version.
  • Older over newer in the same branch is now refused by a launch condition. Published releases don't have this check.

The README documents all of this, plus the fact that there is no Modify (changing options means uninstall and install again). New tests cover these paths in the lifecycle, package and GUI suites. CI builds the extra installers they need from the same binaries. Checked on Windows 10 with local x86 builds.

Fixes #41

Uninstall keeps config\openssl.cnf but deletes fipsmodule.cnf. After
uninstalling a FIPS install, the leftover openssl.cnf includes a file
that no longer exists. When Windows Installer considers the leftover
edited, it keeps it on the next install, so openssl.exe fails at
startup and a FIPS install fails in its fipsinstall step (error 1722).

On a fresh install (not an upgrade), move a leftover openssl.cnf to
openssl.cnf.<yyyyMMdd-HHmmss>.bak before the files are installed, so
the shipped configuration is used and earlier backups are kept.
Upgrades keep the existing configuration.

Fixes openssl#41

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quarckster

Copy link
Copy Markdown
Member Author

/ci

@quarckster
quarckster requested a review from jogme December 3, 2026 16:41

@jogme jogme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to notify the user, about this action - about failure and success too, so they know they need to take care of their config file and won't just silently start openssl to work differently.

I'd add a warning maybe to the last window (saying the install was successful) about the moved old config. If the install fails then the config should be moved back to have a clean rollback.

Comment thread windows-installer/openssl.aip Resolved
quarckster and others added 2 commits December 4, 2026 10:25
Replace the cmd one-liner that moved a leftover openssl.cnf with inline
PowerShell custom actions:

- FindLeftoverConfig runs on a fresh install once the wizard is done,
  or in the execute sequence for a silent install. It picks the backup
  name, stores it in CONFIG_BACKUP and checks that no other program
  holds the leftover open. If one does, the user can close it and retry
  or cancel, instead of the move failing later.
- BackupConfig moves the leftover to that name before the files are
  installed, and BackupConfigRollback moves it back if the install
  fails.
- The final dialog tells the user where the old configuration went.

CONFIG_BACKUP is a secure custom property, so the value set in the
wizard reaches the elevated install.

Test a locked leftover, a failure after the move and the wizard flow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Upgrade table detects an installed newer version into
AI_NEWERPRODUCTFOUND, but nothing acted on it: an older package
installed silently over the newer one (exit 0), and both products stayed
registered for the same folder. A launch condition now stops the
install with "A newer version of OpenSSL Library is already installed."

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quarckster

Copy link
Copy Markdown
Member Author

/ci

@quarckster quarckster changed the title Back up a leftover openssl.cnf on a fresh install Keep openssl.cnf on upgrade and back up a leftover one on a fresh install Dec 4, 2026
quarckster and others added 2 commits December 4, 2026 13:56
An upgrade within a release branch now only replaces the binaries.
ReadPreviousSettings reads the previous version's folder and choices
(application, SDK, PATH, FIPS and its type) from what is installed and
sets KEEP_SETTINGS, which keeps config\openssl.cnf as it is and makes
the wizard go from the license straight to the install. Before, an
upgrade overwrote the user's openssl.cnf, which also turned FIPS off.
fipsinstall still runs, so fipsmodule.cnf matches the new module.

The Upgrade table now only matches versions of the same release branch,
so different branches install side by side, each into its own folder.

Document upgrades, side-by-side branches, uninstall, the missing Modify
and the leftover backup in the README, and fix INSTALL_APPS there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The upgrade tests installed the newest published release first. That
made them depend on the network and on what happened to be published,
and they skipped for the first release of a branch and for side by side
until another branch was released.

CI now builds two more MSIs from the same binaries, stamped as the next
patch release and as the first release of the next branch, and the
upgrade, refusal and side-by-side tests use them. --previous-installer
still upgrades from a given release, such as the last published one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quarckster

Copy link
Copy Markdown
Member Author

/ci

quarckster and others added 2 commits December 4, 2026 15:10
Adjust PATH also prepends the include and lib folders to INCLUDE and
LIB. The branch installed or upgraded last comes first in all three, and
every branch of a major version ships the same DLL names, so programs
that find OpenSSL through PATH, and builds that use INCLUDE and LIB, get
that branch. Registry keys and each branch's own openssl.exe are not
affected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Different release branches already installed side by side: Advanced
Installer's side-by-side option removes an older version only when it is
in the same folder, and each branch has its own. The Upgrade table is
limited to the release branch because of what this branch added: with
rows matching any older version, ReadPreviousSettings takes another
branch over as the previous version (folder, options and openssl.cnf),
and the newer-version launch condition refuses to install an older
branch next to a newer one. The side-by-side test only installed the
older branch first, so it missed the second case; it now runs in both
orders, and fails in both with rows that match other branches.

The README warns against installing two branches into one folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quarckster
quarckster requested a review from jogme December 4, 2026 15:06

@jogme jogme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the feeling that the upgrade version check logic will need some rework in the future, but good to go for now.

@openssl-machine
openssl-machine merged commit 4b4a179 into openssl:main Dec 4, 2026
4 checks passed
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.

4.1.1 installer fails

3 participants