On 23 March 2018 at 11:31, Ben Coman <btc@openinworld.com> wrote:


On 23 March 2018 at 05:14, C��drick B��ler <cdrick65@gmail.com> wrote:
Hi,

I just saw students and they still have some problem on windows with the launcher.

First, the launcher has to be run in admin mode.

Then, the image download starts but there is an error when uncompressing. Here is the stack.

Any idea on how to fix that ?

Now I notice...��
the Linux PharoLauncher download is a ZIP file
and the Mac PharoLauncher download is a ZIP file
so... can we make the Windows PharoLauncher download a ZIP file?

Doing that, at least as an interim measure, would *immediately* make PharoLauncher��
usable to students on locked-down Windows machines in University student labs.
I'd expect this will improve the success with this experiment��
to use PharoLauncher as the main user entry point.

The problem with using an "Installer" for the Windows PharoLauncher is the large amount��
of testing required to work *reliably* with *all* the "different ways people work"
under several different versions of Windows introduced different layers of user security intricacies.��
Lets move forward in small steps.�� A ZIP download/extract is simple, and consistent with other platforms.

In the meantime while waiting for that to happen, you can...


2. Rename�� Pharo6.1�� �� folder to�� PharoLauncher
�� �� Rename�� Pharo6.1.*�� files to�� �� PharoLauncher1.1.*

3. Metacello new
�� �� �� ��smalltalkhubUser: 'Pharo'
�� �� �� ��project: 'PharoLauncher';
�� �� �� ��configuration: 'PharoLauncher';
�� �� �� ��load.
�� �� PhLDeploymentScript doAll.
�� �� PharoLauncher open.
�� �� Smalltalk snapshot: true�� andQuit: true.

4. Zip up the parent folder, test on another machine and provide a link to your students.

cheers -ben


P.S.�� I was going to suggest also renaming�� Pharo.exe�� to�� PharoLauncher.exe
but with an empty Documents\Pharo\vms
I get... "Error: Cannot detect Pharo executable in C:\Temp\MyPharoLauncher\PharoLauncher"
in PhLVirtualMachine>>initializeOn:��"File @ C:\Temp\MyPharoLauncher\PharoLauncher"
since "executables := aFolder allChildrenMatching: self class executableName."
is empty since "self class executableName" ==> "Pharo.exe"

It would be nice for that to not be hard coded.�� I tried digging further but ran out of time.
I am curious it mattered since using "Pharo.exe" the Launcher went on to download a VM anyway.


P.S.2.
I believe the best path forward for system-wide PharoLauncher installed under "C:\Program Files"
would be to install there only...
* the VM��
* PharoLauncher.ZIP��
* a tiny non-Pharo wrapper program as the shortcut linked from AllUsers > Start Menu > PharoLauncher��
that extracts PharoLauncher.ZIP to the user's data area and then starts that user specific PharoLauncher.����

Then regardless whether:
* they individually download/extract�� PharoLauncher.ZIP
* the system-wide-wrapper��extracts����PharoLauncher.ZIP
its a similar experience for users��which should aid reliability by reducing the number of "different " use cases.

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
The important part of�� (free) Basic Features�� is "Windows 10/8/7/Vista and UAC installs"
Also further down are some CI options.��

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
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

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";
�� �� �� �� �� WshShell = WScript.CreateObject("WScript.Shell");
�� �� �� �� �� fso = WScript.CreateObject("Scripting.FileSystemObject");
�� �� �� �� �� systemFolder = fso.GetAbsolutePathName(".");
�� �� �� �� �� vmFilename = systemFolder + "\\Pharo.exe"
�� �� �� �� �� systemBasename = systemFolder + "\\PerUserFiles" + basename;
�� �� �� �� �� userFolder = WshShell.ExpandEnvironmentStrings("%LOCALAPPDATA%\\Pharo");
�� �� �� �� �� userFolder2 = userFolder + "\\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")


cheers -ben