From 6c3f8e30dbd9ae8687eb4380bf19298017093d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my?= Date: Mon, 20 Mar 2017 23:51:36 +0100 Subject: [PATCH 01/12] persist mariadb data --- mariadb.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mariadb.json b/mariadb.json index 717fadf41e..70f2027c80 100644 --- a/mariadb.json +++ b/mariadb.json @@ -47,6 +47,9 @@ "bin\\mysql_upgrade_wizard.exe", "bin\\my_print_defaults.exe" ], + "persist": [ + "data" + ], "checkver": { "url": "https://downloads.mariadb.org/", "re": "Download ([\\d.]+) Stable" From 8c0745137c5e9c4e8913da296b44556a9f01e4da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my?= Date: Thu, 23 Mar 2017 00:38:24 +0100 Subject: [PATCH 02/12] mysql persist database content --- mysql.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mysql.json b/mysql.json index 9b2c3ebfcf..4f64dea55e 100644 --- a/mysql.json +++ b/mysql.json @@ -26,9 +26,14 @@ "bin\\mysqlslap.exe", "bin\\my_print_defaults.exe" ], + "persist": [ + "data" + ], "post_install": " #Initialize data directory (without generating root password) -mysqld --initialize-insecure +if (!(Test-Path \"$dir\\data\\auto.cnf\")) { + mysqld --initialize-insecure +} #Copy provided sample file to live file location cp $dir/my-default.ini $dir/my.ini From de9034d5a654c88ee02b36e90d3ef2afa41fb7e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my?= Date: Thu, 23 Mar 2017 00:55:15 +0100 Subject: [PATCH 03/12] php: use data_dir for configuration scan_dir --- php.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/php.json b/php.json index 3c3b705a5c..e0379b8671 100644 --- a/php.json +++ b/php.json @@ -29,9 +29,15 @@ "php-cgi.exe" ], "env_set": { - "PHP_INI_SCAN_DIR": "$dir\\..\\conf" + "PHP_INI_SCAN_DIR": "$data_dir\\conf" }, "post_install": " +#Copy ini scan dir from old location before persistant update +if ((Test-Path \"$dir\\..\\conf\") -and !(Test-Path \"$data_dir\\conf\")) { + Write-Host 'We are moving your php configuration to scoop/data/php/conf' + mv \"$dir\\..\\conf\" \"$data_dir\\conf\" +} + #Copy PHP configuration file to expected location cp \"$dir\\php.ini-production\" \"$dir\\php.ini\" From 5bfd9daff8eb3e00af0036b1388e089ee1f1b298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my?= Date: Thu, 23 Mar 2017 00:55:33 +0100 Subject: [PATCH 04/12] php: remove configuration transfer (would not work) --- php.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/php.json b/php.json index e0379b8671..cd5c0b8493 100644 --- a/php.json +++ b/php.json @@ -32,12 +32,6 @@ "PHP_INI_SCAN_DIR": "$data_dir\\conf" }, "post_install": " -#Copy ini scan dir from old location before persistant update -if ((Test-Path \"$dir\\..\\conf\") -and !(Test-Path \"$data_dir\\conf\")) { - Write-Host 'We are moving your php configuration to scoop/data/php/conf' - mv \"$dir\\..\\conf\" \"$data_dir\\conf\" -} - #Copy PHP configuration file to expected location cp \"$dir\\php.ini-production\" \"$dir\\php.ini\" From bea5cd182778bca5f46f1cede277369f50998c20 Mon Sep 17 00:00:00 2001 From: Luke Sampson Date: Fri, 24 Mar 2017 19:09:28 +1100 Subject: [PATCH 05/12] Persistence: prevent NPM from overwriting node_modules by setting read-only attribute on the persisted directory junction. --- nodejs.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nodejs.json b/nodejs.json index 74e4a84b3c..4368445c66 100644 --- a/nodejs.json +++ b/nodejs.json @@ -13,9 +13,10 @@ } }, "env_add_path": "nodejs", + "persist": "nodejs/node_modules", "post_install": " # Remove npmrc that makes global modules get installed in AppData\\Roaming\\npm -rm $dir\\nodejs\\node_modules\\npm\\npmrc +if(test-path $dir\\nodejs\\node_modules\\npm\\npmrc) { rm $dir\\nodejs\\node_modules\\npm\\npmrc } npm update -g", "checkver": { "url": "https://nodejs.org/en/download/current/", From 770b32ca006721cde2fe94853033b823c74e6d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my?= Date: Sat, 25 Mar 2017 13:18:01 +0100 Subject: [PATCH 06/12] nodejs persistence: use npm prefix to install bins into data dir / env_add_path with $data_dir --- nodejs.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nodejs.json b/nodejs.json index 4368445c66..38246619b4 100644 --- a/nodejs.json +++ b/nodejs.json @@ -12,11 +12,11 @@ "hash": "2888f2303bcaa35f05b3dce7cbfee58af77dcea6bed4b9ff549b181c65eb4565" } }, - "env_add_path": "nodejs", + "env_add_path": ["nodejs", "$data_dir"], "persist": "nodejs/node_modules", "post_install": " -# Remove npmrc that makes global modules get installed in AppData\\Roaming\\npm -if(test-path $dir\\nodejs\\node_modules\\npm\\npmrc) { rm $dir\\nodejs\\node_modules\\npm\\npmrc } +# Set npm prefix to install module inside $data_dir +Set-Content -Value \"prefix=$data_dir\" -Path $data_dir\\node_modules\\npm\\npmrc npm update -g", "checkver": { "url": "https://nodejs.org/en/download/current/", From 060690c41291848c0b6d577b9b1917325a29897a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my?= Date: Sat, 25 Mar 2017 13:42:49 +0100 Subject: [PATCH 07/12] persist nginx --- nginx.json | 1 + 1 file changed, 1 insertion(+) diff --git a/nginx.json b/nginx.json index d2b56904ac..29640e890f 100644 --- a/nginx.json +++ b/nginx.json @@ -6,6 +6,7 @@ "hash": "53ca945ffd3ceaa40c2c60e01218a3b7ac64e61d3907484461794ee13757cce9", "extract_dir": "nginx-1.11.12", "bin": "nginx.exe", + "persist": ["conf", "html", "logs"], "checkver": { "url": "https://nginx.org/en/CHANGES", "re": "Changes with nginx ([\\d.]+)" From 51e574f13f7fcb1fc255b34f053ce3b25a300f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my?= Date: Sat, 25 Mar 2017 16:26:59 +0100 Subject: [PATCH 08/12] update python 3.6.1 / add autoupdate --- python.json | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/python.json b/python.json index a5b8646400..33afda8633 100644 --- a/python.json +++ b/python.json @@ -1,18 +1,18 @@ { "homepage": "https://www.python.org/", "license": "https://docs.python.org/3/license.html", - "version": "3.6.0", + "version": "3.6.1", "architecture": { "64bit": { - "url": "https://www.python.org/ftp/python/3.6.0/python-3.6.0-amd64.exe#/py360.exe", - "hash": "md5:71c9d30c1110abf7f80a428970ab8ec2" + "url": "https://www.python.org/ftp/python/3.6.1/python-3.6.1-amd64.exe#/py3.exe", + "hash": "591922fbf5c4234b766dd672e539cba3d9a158e028e3c85c76bfec6ede56ded8" }, "32bit": { - "url": "https://www.python.org/ftp/python/3.6.0/python-3.6.0.exe#/py360.exe", - "hash": "md5:38d9b036b25725f6acb553d4aece4db4" + "url": "https://www.python.org/ftp/python/3.6.1/python-3.6.1.exe#/py3.exe", + "hash": "15dbc083264945ad1dcef8b0b712da41362f816f614acb60989541d8f426d845" } }, - "pre_install": "copy-item $dir\\py360.exe $dir\\uninstall.exe", + "pre_install": "copy-item $dir\\py3.exe $dir\\uninstall.exe", "installer": { "args": [ "/quiet", @@ -25,14 +25,32 @@ }, "uninstaller": { "file": "uninstall.exe", - "args": [ "/uninstall", "/quiet", "InstallAllUsers=0"] + "args": [ + "/uninstall", + "/quiet", + "InstallAllUsers=0" + ] }, "bin": [ "python.exe", "pythonw.exe", - [ "python.exe", "python3" ] + [ + "python.exe", + "python3" + ] ], - "env_add_path": [ "scripts" ], - "checkver": "

Latest: Python ([\\d.]+) - .*

" + "env_add_path": [ + "scripts" + ], + "checkver": "

Latest: Python ([\\d.]+) - .*

", + "autoupdate": { + "architecture": { + "64bit": { + "url": "https://www.python.org/ftp/python/$version/python-$version-amd64.exe#/py3.exe" + }, + "32bit": { + "url": "https://www.python.org/ftp/python/$version/python-$version.exe#/py3.exe" + } + } + } } - From e928a37a014733cbe215ca2c57d8f05c3f41537e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my?= Date: Sat, 25 Mar 2017 17:13:23 +0100 Subject: [PATCH 09/12] persist ruby gems by using GEM_HOME and GEM_ROOT --- ruby.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ruby.json b/ruby.json index 89176035b9..1dbaef8250 100644 --- a/ruby.json +++ b/ruby.json @@ -26,7 +26,11 @@ } }, "extract_to": [ "", "devkit" ], - "env_add_path": "bin", + "env_add_path": ["bin", "$data_dir\\gem\\bin"], + "env_set": { + "GEM_HOME": "$data_dir\\gem", + "GEM_PATH": "$data_dir\\gem" + }, "post_install": "pushd $dir\\devkit;echo \"---`n- $dir\" | out-file config.yml -enc default; ruby dk.rb install;popd;", "checkver": { "url": "http://rubyinstaller.org/downloads/", From 4807b20bcb0ac54b88028b51fad4c34faf08a2d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my?= Date: Sun, 26 Mar 2017 14:08:58 +0200 Subject: [PATCH 10/12] normalize persist terms --- nodejs.json | 6 +++--- php.json | 2 +- ruby.json | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nodejs.json b/nodejs.json index 38246619b4..b0ed23cb47 100644 --- a/nodejs.json +++ b/nodejs.json @@ -12,11 +12,11 @@ "hash": "2888f2303bcaa35f05b3dce7cbfee58af77dcea6bed4b9ff549b181c65eb4565" } }, - "env_add_path": ["nodejs", "$data_dir"], + "env_add_path": ["nodejs", "$persist_dir"], "persist": "nodejs/node_modules", "post_install": " -# Set npm prefix to install module inside $data_dir -Set-Content -Value \"prefix=$data_dir\" -Path $data_dir\\node_modules\\npm\\npmrc +# Set npm prefix to install module inside $persist_dir +Set-Content -Value \"prefix=$persist_dir\" -Path $persist_dir\\node_modules\\npm\\npmrc npm update -g", "checkver": { "url": "https://nodejs.org/en/download/current/", diff --git a/php.json b/php.json index cd5c0b8493..de1b5d4187 100644 --- a/php.json +++ b/php.json @@ -29,7 +29,7 @@ "php-cgi.exe" ], "env_set": { - "PHP_INI_SCAN_DIR": "$data_dir\\conf" + "PHP_INI_SCAN_DIR": "$persist_dir\\conf" }, "post_install": " #Copy PHP configuration file to expected location diff --git a/ruby.json b/ruby.json index 1dbaef8250..837e691dc6 100644 --- a/ruby.json +++ b/ruby.json @@ -26,10 +26,10 @@ } }, "extract_to": [ "", "devkit" ], - "env_add_path": ["bin", "$data_dir\\gem\\bin"], + "env_add_path": ["bin", "$persist_dir\\gem\\bin"], "env_set": { - "GEM_HOME": "$data_dir\\gem", - "GEM_PATH": "$data_dir\\gem" + "GEM_HOME": "$persist_dir\\gem", + "GEM_PATH": "$persist_dir\\gem" }, "post_install": "pushd $dir\\devkit;echo \"---`n- $dir\" | out-file config.yml -enc default; ruby dk.rb install;popd;", "checkver": { From 423fd3cb887afddba4f4db8251066caebef39774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my?= Date: Sun, 26 Mar 2017 14:23:27 +0200 Subject: [PATCH 11/12] persist php conf: migrate old configuration to new persist directory on post_install --- php.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/php.json b/php.json index de1b5d4187..312f18fda4 100644 --- a/php.json +++ b/php.json @@ -32,6 +32,12 @@ "PHP_INI_SCAN_DIR": "$persist_dir\\conf" }, "post_install": " +#Copy ini scan dir from old location before persistant update +if ((Test-Path \"$dir\\..\\conf\") -and !(Test-Path \"$persist_dir\\conf\")) { + Write-Host -ForegroundColor Cyan 'We are moving your php configuration to scoop/persist/php/conf' + Move-Item \"$dir\\..\\conf\" \"$persist_dir\\conf\" +} + #Copy PHP configuration file to expected location cp \"$dir\\php.ini-production\" \"$dir\\php.ini\" From d93f98fd1d37519fc175911dcc053d9de074193a Mon Sep 17 00:00:00 2001 From: Luke Sampson Date: Thu, 30 Mar 2017 09:13:27 +1100 Subject: [PATCH 12/12] NodeJS without $persist_dir in env_add_path / mark persist dirs as read-only (#1) * A NodeJS install with persistence that doesn't use $persist_dir variable in manifest * persist nodejs fix npm updating itself * A NodeJS install with persistence that doesn't use $persist_dir variable in manifest * Fix 'Access is denied' error removing 'current' directory junction. * change nodejs install behaviour to match upstream installer `npm update -g` has been remove because it has no effect on the installed npm version and does not match the official installer behaviour. --- nodejs.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nodejs.json b/nodejs.json index b0ed23cb47..c454ef4352 100644 --- a/nodejs.json +++ b/nodejs.json @@ -12,12 +12,12 @@ "hash": "2888f2303bcaa35f05b3dce7cbfee58af77dcea6bed4b9ff549b181c65eb4565" } }, - "env_add_path": ["nodejs", "$persist_dir"], - "persist": "nodejs/node_modules", + "extract_dir": "nodejs", + "persist": [ "bin" ], + "env_add_path": [ ".", "bin" ], "post_install": " -# Set npm prefix to install module inside $persist_dir -Set-Content -Value \"prefix=$persist_dir\" -Path $persist_dir\\node_modules\\npm\\npmrc -npm update -g", +# Set npm prefix to install modules inside bin +Set-Content -Value \"prefix=$dir\\bin\" -Path $dir\\node_modules\\npm\\npmrc", "checkver": { "url": "https://nodejs.org/en/download/current/", "re": "Current version: v([\\d.]+)"