Hi Ben,
Le 23 mars 2018 à 19:53, Ben Coman <btc@openinworld.com> a écrit :
Coincidentally I have returned to Windows for a short while so thought I should put my money where my mouth is and have a stab at this. After a few hours trying with NSIS, I went searching for an alternative and Advanced Installer looked like a good chance. https://www.advancedinstaller.com/feats-list.html <https://www.advancedinstaller.com/feats-list.html> The important part of (free) Basic Features is "Windows 10/8/7/Vista and UAC installs" Also further down are some CI options.
What bothers me is that it is not a free tool. I can see the list of features here: https://www.advancedinstaller.com/feats-list.html
After just the "Simple Installation" tutorial and experimenting a few hours I ironed out a potential solution uploaded for testing to http://www.mediafire.com/file/3g579bmzqspt8e1/BCPharoLauncher.msi <http://www.mediafire.com/file/3g579bmzqspt8e1/BCPharoLauncher.msi> with the full build tree at http://www.mediafire.com/file/5ijiww848lbkk7m/PharoLauncher%20Advanced%20Ins... <http://www.mediafire.com/file/5ijiww848lbkk7m/PharoLauncher%20Advanced%20Ins...> Links should be live for 30 days. I've directly attached the much smaller installer-configuration file "PharoLauncher.aip".
PharoLauncher was built with some minor changes from above... 1. Download/extracted http://files.pharo.org/platform/Pharo6.1-win.zip <http://files.pharo.org/platform/Pharo6.1-win.zip>
2. Renamed Pharo6.1 folder to BCPharoLauncher Renamed Pharo6.1.* files to PharoLauncher1.1.*
3. Metacello new smalltalkhubUser: 'Pharo' project: 'PharoLauncher'; configuration: 'PharoLauncher'; load. PharoLauncher hardResetPersistanceState: true. PhLDeploymentScript doAll. PhLDeploymentScript closeWindowsAndOpenLauncher. Smalltalk snapshot: true andQuit: true.
4. Moved the image & changes files into a subfolder "PerUserFiles"
5. Built BCPharoLauncher.msi
I prefixed my initials to distinguish it from the current official PharoLauncher installer. Hopefully this can be adopted as the official installer and they can be dropped off.
Key features: a. Provides a choice to install for "Everybody" (i.e. C:\Program Files (x86)\Pharo\BCPharoLauncher\) or "Only for me" (i.e. C:\Users\Ben\AppData\Local\Programs\Pharo\BCPharoLauncher\) per attached screen snapshot.
b. Start the install as a Standard User and it escalates only as needed.
c. The Desktop and Start Menu shortcuts run the following script... // File: PharoLauncher.js // Author: Ben Coman 2018.03.24 // Purpose: Facilitate each user to run a personal copy of PharoLauncher.image in their own data area.
// Locations basename = "\\PharoLauncher1.1 <smb://PharoLauncher1.1>"; WshShell = WScript.CreateObject("WScript.Shell"); fso = WScript.CreateObject("Scripting.FileSystemObject"); systemFolder = fso.GetAbsolutePathName("."); vmFilename = systemFolder + "\\Pharo.exe <smb://Pharo.exe>" systemBasename = systemFolder + "\\PerUserFiles <smb://PerUserFiles>" + basename; userFolder = WshShell.ExpandEnvironmentStrings("%LOCALAPPDATA%\\Pharo"); userFolder2 = userFolder + "\\PharoLauncher <smb://PharoLauncher>"; userBasename = userFolder2 + basename;
// Ensure user data folder exists for PharoLauncher if( ! fso.FolderExists(userFolder)) { fso.CreateFolder(userFolder); fso.CreateFolder(userFolder2) }
// If either image or changes files missing from user folder, copy from system folder. if( ! fso.FileExists(userBasename + ".image") || ! fso.FileExists(userBasename + ".changes")) { //WScript.Echo("Setting up user environment"); fso.CopyFile(systemBasename + ".image", userBasename + ".image", true); fso.CopyFile(systemBasename + ".changes", userBasename + ".changes", true); }
// Start personal copy of PharoLauncher WshShell.Exec(vmFilename + " " + userBasename + ".image »)
UAC support is really nice. I would like to have the community opinion on using a non-free tool like advancedinstaller. If there is no objection, I would consider it seriously for a next Pharo Launcher version. Thanks for this work Ben!