Commit 2237bdc5 authored by Steve Dower's avatar Steve Dower

Adds option to install launcher for all users even when installing Python...

Adds option to install launcher for all users even when installing Python just-for-me. This helps mitigate issues when the incompatible Python 3.4 launcher is installed.
Enables installer builds with the the text marker.
Allows simple installs to include a custom description.
parent 8cc80f1d
This diff was suppressed by a .gitattributes entry.
......@@ -130,6 +130,9 @@ of available options is shown below.
+---------------------------+--------------------------------------+--------------------------+
| Include_launcher | Install :ref:`launcher`. | 1 |
+---------------------------+--------------------------------------+--------------------------+
| InstallLauncherAllUsers | Installs :ref:`launcher` for all | 1 |
| | users. | |
+---------------------------+--------------------------------------+--------------------------+
| Include_lib | Install standard library and | 1 |
| | extension modules | |
+---------------------------+--------------------------------------+--------------------------+
......@@ -145,6 +148,9 @@ of available options is shown below.
+---------------------------+--------------------------------------+--------------------------+
| SimpleInstall | Disable most install UI | 0 |
+---------------------------+--------------------------------------+--------------------------+
| SimpleInstallDescription | A custom message to display when the | (empty) |
| | simplified install UI is used. | |
+---------------------------+--------------------------------------+--------------------------+
For example, to silently install a default, system-wide Python installation,
you could use the following command (from an elevated command prompt)::
......@@ -152,9 +158,11 @@ you could use the following command (from an elevated command prompt)::
python-3.5.0.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
To allow users to easily install a personal copy of Python without the test
suite, you could provide a shortcut with the following command::
suite, you could provide a shortcut with the following command. This will
display a simplified initial page and disallow customization::
python-3.5.0.exe /passive InstallAllUsers=0 Include_launcher=0 Include_test=0 SimpleInstall=1
python-3.5.0.exe InstallAllUsers=0 Include_launcher=0 Include_test=0
SimpleInstall=1 SimpleInstallDescription="Just for me, no test suite."
(Note that omitting the launcher also omits file associations, and is only
recommended for per-user installs when there is also a system-wide installation
......
......@@ -6,12 +6,14 @@ set PCBUILD=%D%..\..\PCBuild\
set BUILDX86=
set BUILDX64=
set BUILDDOC=
set BUILDPX=
:CheckOpts
if "%~1" EQU "-h" goto Help
if "%~1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts
if "%~1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts
if "%~1" EQU "--doc" (set BUILDDOC=1) && shift && goto CheckOpts
if "%~1" EQU "--test-marker" (set BUILDPX=1) && shift && goto CheckOpts
if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
......@@ -35,22 +37,28 @@ if defined BUILDDOC (
if errorlevel 1 goto :eof
)
set BUILD_CMD="%D%bundle\snapshot.wixproj"
if defined BUILDPX (
set BUILD_CMD=%BUILD_CMD% /p:UseTestMarker=true
)
if defined BUILDX86 (
"%PCBUILD%win32\python.exe" "%D%get_wix.py"
msbuild "%D%bundle\snapshot.wixproj"
msbuild %BUILD_CMD%
if errorlevel 1 goto :eof
)
if defined BUILDX64 (
"%PCBUILD%amd64\python.exe" "%D%get_wix.py"
msbuild "%D%bundle\snapshot.wixproj" /p:Platform=x64
msbuild /p:Platform=x64 %BUILD_CMD%
if errorlevel 1 goto :eof
)
exit /B 0
:Help
echo build.bat [-x86] [-x64] [--doc] [-h]
echo build.bat [-x86] [-x64] [--doc] [-h] [--test-marker]
echo.
echo -x86 Build x86 installers
echo -x64 Build x64 installers
echo --doc Build CHM documentation
echo --test-marker Build installers with 'x' markers
......@@ -21,10 +21,11 @@
<Text X="185" Y="50" Width="-11" Height="50" FontId="3" TabStop="yes">#(loc.InstallMessage)</Text>
<Button Name="InstallButton" X="175" Y="101" Width="-11" Height="129" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.InstallButton)</Button>
<Button Name="InstallCustomButton" X="175" Y="241" Width="-11" Height="59" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.InstallCustomButton)</Button>
<Button Name="InstallButton" X="175" Y="101" Width="-11" Height="109" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.InstallButton)</Button>
<Button Name="InstallCustomButton" X="175" Y="221" Width="-11" Height="59" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.InstallCustomButton)</Button>
<Checkbox Name="PrependPath" X="185" Y="-13" Width="-100" Height="20" TabStop="yes" FontId="3">#(loc.ShortPrependPathLabel)</Checkbox>
<Checkbox Name="InstallLauncherAllUsers" X="185" Y="-33" Width="-100" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.ShortInstallLauncherAllUsersLabel)</Checkbox>
<Button Name="InstallCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CancelButton)</Button>
</Page>
......@@ -43,7 +44,7 @@
<Text X="185" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.InstallHeader)</Text>
<Image X="0" Y="0" Width="162" Height="352" ImageFile="SideBar.png"/>
<Button Name="InstallSimpleButton" X="175" Y="101" Width="-11" Height="59" TabStop="yes" FontId="3" HideWhenDisabled="yes" HexStyle="0xF">#(loc.InstallSimpleButton)</Button>
<Button Name="InstallSimpleButton" X="175" Y="101" Width="-11" Height="129" TabStop="yes" FontId="3" HideWhenDisabled="yes" HexStyle="0xF">#(loc.InstallSimpleButton)</Button>
<Button Name="InstallCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CancelButton)</Button>
</Page>
......@@ -63,7 +64,8 @@
<Checkbox Name="Include_test" X="185" Y="186" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_testLabel)</Checkbox>
<Text X="205" Y="206" Width="-11" Height="20" TabStop="no" FontId="5">#(loc.Include_testHelpLabel)</Text>
<Checkbox Name="Include_launcher" X="185" Y="231" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_launcherLabel)</Checkbox>
<Checkbox Name="Include_launcher" X="185" Y="231" Width="100" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_launcherLabel)</Checkbox>
<Checkbox Name="CustomInstallLauncherAllUsers" X="285" Y="231" Width="-11" Height="20" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallLauncherAllUsersLabel)</Checkbox>
<Text X="205" Y="251" Width="-11" Height="20" TabStop="no" FontId="5">#(loc.Include_launcherHelpLabel)</Text>
<Button Name="Custom1BackButton" X="185" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.CustomBackButton)</Button>
......
......@@ -50,7 +50,9 @@ Creates shortcuts and file associations</String>
<String Id="InstallCustomButton">C&amp;ustomize installation</String>
<String Id="InstallCustomButtonNote">Choose location and features</String>
<String Id="InstallSimpleButton">&amp;Install</String>
<String Id="InstallSimpleButtonNote">Uses setting preselected by your administrator</String>
<String Id="InstallSimpleButtonNote">Use settings preselected by your administrator
[SimpleInstallDescription]</String>
<String Id="InstallUpgradeButton">&amp;Upgrade Now</String>
<String Id="InstallUpgradeButtonNote">[TargetDir]
......@@ -81,7 +83,9 @@ Select Customize to review current options.</String>
<String Id="ShortcutsLabel">Create shortcuts for installed applications</String>
<String Id="PrependPathLabel">Add Python to &amp;environment variables</String>
<String Id="ShortPrependPathLabel">Add &amp;Python [ShortVersion] to PATH</String>
<String Id="InstallAllUsersLabel">Install as &amp;Administrator</String>
<String Id="InstallAllUsersLabel">Install for &amp;all users</String>
<String Id="InstallLauncherAllUsersLabel">for &amp;all users (requires elevation)</String>
<String Id="ShortInstallLauncherAllUsersLabel">Install &amp;launcher for all users (recommended)</String>
<String Id="PrecompileLabel">&amp;Precompile standard library</String>
<String Id="Include_symbolsLabel">Install debugging &amp;symbols</String>
<String Id="Include_debugLabel">Install debu&amp;g binaries (requires VS 2015 or later)</String>
......
......@@ -88,7 +88,7 @@
<Target Name="BuildLauncher" BeforeTargets="BeforeBuild" Condition="'$(RebuildAll)' != 'false'">
<!-- Build the launcher MSI using Exec rather than MSBuild -->
<Exec Command='msbuild ..\launcher\launcher.wixproj /p:Platform=x86 /p:OutputPath="$(BuildPath.TrimEnd(`\`))" /p:OutputSuffix=$(Platform) /p:BuildForRelease=$(BuildForRelease)'
<Exec Command='msbuild ..\launcher\launcher.wixproj /p:Platform=x86 /p:OutputPath="$(BuildPath.TrimEnd(`\`))" /p:OutputSuffix=$(Platform) /p:BuildForRelease=$(BuildForRelease) /p:UseTestMarker=$(UseTestMarker)'
ContinueOnError="false" />
</Target>
......
......@@ -24,15 +24,16 @@
<Variable Name="ShortVersionNoDot" Value="$(var.MajorVersionNumber)$(var.MinorVersionNumber)" />
<Variable Name="InstallAllUsers" Value="0" bal:Overridable="yes" />
<Variable Name="InstallLauncherAllUsers" Value="1" bal:Overridable="yes" />
<Variable Name="TargetDir" Value="" bal:Overridable="yes" />
<?if $(var.Platform)~="x64" ?>
<Variable Name="DefaultAllUsersTargetDir" Value="[ProgramFiles64Folder]Python [ShortVersion]" bal:Overridable="yes" />
<Variable Name="DefaultAllUsersTargetDir" Value="[ProgramFiles64Folder]$(var.TestPrefix)Python [ShortVersion]" bal:Overridable="yes" />
<Variable Name="TargetPlatform" Value="x64" />
<?else ?>
<Variable Name="DefaultAllUsersTargetDir" Value="[ProgramFilesFolder]Python [ShortVersion]" bal:Overridable="yes" />
<Variable Name="DefaultAllUsersTargetDir" Value="[ProgramFilesFolder]$(var.TestPrefix)Python [ShortVersion]" bal:Overridable="yes" />
<Variable Name="TargetPlatform" Value="x86" />
<?endif ?>
<Variable Name="DefaultJustForMeTargetDir" Value="[LocalAppDataFolder]Programs\Python\Python[ShortVersionNoDot]$(var.Suffix32)" bal:Overridable="yes" />
<Variable Name="DefaultJustForMeTargetDir" Value="[LocalAppDataFolder]Programs\$(var.TestPrefix)Python\Python[ShortVersionNoDot]$(var.Suffix32)" bal:Overridable="yes" />
<Variable Name="OptionalFeaturesRegistryKey" Value="Software\$(var.TestPrefix)Python\PythonCore\[ShortVersion]$(var.Suffix32)\InstalledFeatures" />
<Variable Name="TargetDirRegistryKey" Value="Software\$(var.TestPrefix)Python\PythonCore\[ShortVersion]$(var.Suffix32)\InstallPath" />
......@@ -45,6 +46,8 @@
<Variable Name="DefaultCustomTargetDir" Value="" bal:Overridable="yes" />
<Variable Name="InstallAllUsersState" Value="enabled" />
<Variable Name="InstallLauncherAllUsersState" Value="enabled" bal:Overridable="yes" />
<Variable Name="CustomInstallLauncherAllUsersState" Value="[InstallLauncherAllUsersState]" />
<Variable Name="TargetDirState" Value="enabled" />
<Variable Name="CustomBrowseButtonState" Value="enabled" />
......@@ -67,6 +70,7 @@
<Variable Name="CompileAll" Value="0" bal:Overridable="yes" />
<Variable Name="SimpleInstall" Value="0" bal:Overridable="yes" />
<Variable Name="SimpleInstallDescription" Value="" bal:Overridable="yes" />
<Chain ParallelCache="yes">
<PackageGroupRef Id="crt" />
......
......@@ -9,7 +9,7 @@
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="yes"
EnableFeatureSelection="yes"
InstallCondition="InstallAllUsers and Include_launcher" />
InstallCondition="(InstallAllUsers or InstallLauncherAllUsers) and Include_launcher" />
<MsiPackage Id="launcher_JustForMe"
SourceFile="launcher.msi"
......@@ -17,7 +17,7 @@
DownloadUrl="$(var.DownloadUrl)"
ForcePerMachine="no"
EnableFeatureSelection="yes"
InstallCondition="not InstallAllUsers and Include_launcher" />
InstallCondition="not (InstallAllUsers or InstallLauncherAllUsers) and Include_launcher" />
</PackageGroup>
</Fragment>
</Wix>
\ No newline at end of file
......@@ -103,7 +103,7 @@
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Directory Id="ProgramMenuFolder">
<Directory Id="MenuDir" Name="!(loc.ProductName)" />
<Directory Id="MenuDir" Name="$(var.TestPrefix)!(loc.ProductName)" />
</Directory>
</DirectoryRef>
</Fragment>
......
......@@ -3,22 +3,22 @@
<Fragment>
<ComponentGroup Id="launcher_exe">
<Component Id="py.exe" Directory="LauncherInstallDirectory" Guid="{B5107402-6958-461B-8B0A-4037D3327160}">
<File Id="py.exe" Name="py.exe" Source="py.exe" KeyPath="yes" />
<File Id="py.exe" Name="py$(var.TestPrefix).exe" Source="py.exe" KeyPath="yes" />
<RegistryValue Root="HKMU" Key="Software\Python\PyLauncher" Value="[#py.exe]" Type="string" />
</Component>
<Component Id="pyw.exe" Directory="LauncherInstallDirectory" Guid="{8E52B8CD-48BB-4D74-84CD-6238BCD11F20}">
<File Id="pyw.exe" Name="pyw.exe" Source="pyw.exe" KeyPath="yes" />
<File Id="pyw.exe" Name="pyw$(var.TestPrefix).exe" Source="pyw.exe" KeyPath="yes" />
</Component>
<Component Id="launcher_path_cu" Directory="LauncherInstallDirectory" Guid="{95AEB930-367C-475C-A17E-A89BFCD4C670}">
<Condition>NOT ALLUSERS=1</Condition>
<RegistryValue KeyPath="yes" Root="HKMU" Key="Software\Python\PyLauncher" Name="InstallDir" Value="[LauncherInstallDirectory]" Type="string" />
<RegistryValue KeyPath="yes" Root="HKMU" Key="Software\$(var.TestPrefix)Python\PyLauncher" Name="InstallDir" Value="[LauncherInstallDirectory]" Type="string" />
<Environment Id="PATH_CU" Action="set" Name="PATH" Part="first" Value="[LauncherInstallDirectory]" />
</Component>
<Component Id="launcher_path_lm" Directory="LauncherInstallDirectory" Guid="{4A41C365-4E27-4D38-A6D1-4A01B4A6500C}">
<Condition>ALLUSERS=1</Condition>
<RegistryValue KeyPath="yes" Root="HKMU" Key="Software\Python\PyLauncher" Name="InstallDir" Value="[LauncherInstallDirectory]" Type="string" />
<RegistryValue KeyPath="yes" Root="HKMU" Key="Software\$(var.TestPrefix)Python\PyLauncher" Name="InstallDir" Value="[LauncherInstallDirectory]" Type="string" />
</Component>
</ComponentGroup>
</Fragment>
......
......@@ -3,7 +3,7 @@
<Fragment>
<ComponentGroup Id="launcher_reg">
<Component Id="file_association" Directory="LauncherInstallDirectory" Guid="{5AF84D9A-D820-456B-B230-6E0105A50276}">
<RegistryValue KeyPath="yes" Root="HKMU" Key="Software\Python\PyLauncher" Name="AssociateFiles" Value="1" Type="integer" />
<RegistryValue KeyPath="yes" Root="HKMU" Key="Software\$(var.TestPrefix)Python\PyLauncher" Name="AssociateFiles" Value="1" Type="integer" />
<ProgId Id="$(var.TestPrefix)Python.File" Description="!(loc.PythonFileDescription)" Advertise="no" Icon="py.exe" IconIndex="1">
<Extension Id="$(var.FileExtension)" ContentType="text/plain">
......
......@@ -81,10 +81,10 @@
<DefineConstants Condition="'$(CRTRedist)' != ''">
$(DefineConstants);CRTRedist=$(CRTRedist);
</DefineConstants>
<DefineConstants Condition="$(Configuration) != 'Debug'">
<DefineConstants Condition="$(UseTestMarker) != 'true'">
$(DefineConstants);TestPrefix=;FileExtension=py;
</DefineConstants>
<DefineConstants Condition="$(Configuration) == 'Debug'">
<DefineConstants Condition="$(UseTestMarker) == 'true'">
$(DefineConstants);TestPrefix=x;FileExtension=px;
</DefineConstants>
<DefineConstants Condition="$(Platform) != 'x64'">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment