diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php
index 31b086636f2..c516cc70aef 100644
--- a/htdocs/install/step5.php
+++ b/htdocs/install/step5.php
@@ -368,13 +368,16 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) {
if ($action == "set") {
if ($success) {
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) {
- // Install is finished
+ // Install is finished (database is on same version than files)
print '
'.$langs->trans("SystemIsInstalled")."
";
+ // Create install.lock file
+ // No need for the moment to create it automatically, creation by web assistant means permissions are given
+ // to the web user, it is better to show a warning to say to create it manually with correct user/permission (not erasable by a web process)
$createlock = 0;
-
if (!empty($force_install_lockinstall) || !empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) {
- // Install is finished, we create the lock file
+ // Install is finished, we create the "install.lock" file, so install won't be possible anymore.
+ // TODO Upgrade will be still be possible if a file "upgrade.unlock" is present
$lockfile = DOL_DATA_ROOT.'/install.lock';
$fp = @fopen($lockfile, "w");
if ($fp) {
@@ -413,13 +416,14 @@ if ($action == "set") {
} elseif (empty($action) || preg_match('/upgrade/i', $action)) {
// If upgrade
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) {
- // Upgrade is finished
+ // Upgrade is finished (database is on same version than files)
print ' '.$langs->trans("SystemIsUpgraded")."
";
+ // Create install.lock file if it does not exists.
+ // Note: it should always exists. A better solution to allow upgrade will be to add an upgrade.unlock file
$createlock = 0;
-
if (!empty($force_install_lockinstall) || !empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) {
- // Upgrade is finished, we create the lock file
+ // Upgrade is finished, we modify the lock file
$lockfile = DOL_DATA_ROOT.'/install.lock';
$fp = @fopen($lockfile, "w");
if ($fp) {
@@ -436,6 +440,10 @@ if ($action == "set") {
print '