Skip to content

Commit 462ccd7

Browse files
committed
reworked UI, added icon and more.
1 parent d7ceb48 commit 462ccd7

11 files changed

Lines changed: 165 additions & 40 deletions

File tree

LuaInstaller.Console/LuaInstaller.Console.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
1111
<CheckEolTargetFramework>false</CheckEolTargetFramework>
1212
<Title>LuaInstaller.Console</Title>
13+
<Description>Easy way to download, build and install Lua on Windows from the command line.</Description>
1314
<Copyright>Copyright © 2017 - 2024 luau-project</Copyright>
1415
<Version>0.5.0.0</Version>
1516
<Authors>luau-project</Authors>

LuaInstaller.Console/Program.cs

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
using LuaInstaller.Core;
22
using System;
3+
using System.Diagnostics;
4+
using System.Reflection;
35

46
namespace LuaInstaller.Console
57
{
68
class Program
79
{
10+
private static string InstallerVersion
11+
{
12+
get
13+
{
14+
Assembly assembly = Assembly.GetExecutingAssembly();
15+
FileVersionInfo assemblyInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
16+
return assemblyInfo.FileVersion;
17+
}
18+
}
19+
20+
private static string InstallerWebsite
21+
{
22+
get
23+
{
24+
return "https://github.com/luau-project/LuaInstaller";
25+
}
26+
}
27+
828
private static void Write(string msg)
929
{
1030
System.Console.WriteLine(msg);
@@ -20,6 +40,12 @@ private static void Help()
2040
LuaInstaller.Console.exe [ /? | help ]
2141
Displays this help message
2242
43+
LuaInstaller.Console.exe [ -v | --version ]
44+
Displays the version of the installer
45+
46+
LuaInstaller.Console.exe help-website
47+
Displays the website of the installer
48+
2349
LuaInstaller.Console.exe list-lua
2450
Lists all Lua versions that this tool
2551
is able to build
@@ -98,12 +124,12 @@ are not set at all.
98124
99125
LuaInstaller.Console.exe install
100126
101-
2) Installs Lua 5.3.6 in the current directory,
127+
2) Installs Lua 5.4.7 in the current directory,
102128
using the latest versions of Visual Studio and
103129
Windows SDK, building the source code for x64
104130
platforms
105131
106-
LuaInstaller.Console.exe install version=5.3.6 arch=x64
132+
LuaInstaller.Console.exe install version=5.4.7 arch=x64
107133
108134
3) Installs Lua 5.1.5 in the folder
109135
'C:\Program Files (x86)\Lua',
@@ -175,6 +201,17 @@ private static int Main(string[] args)
175201
{
176202
Help();
177203

204+
break;
205+
}
206+
case "help-website":
207+
{
208+
Write(InstallerWebsite);
209+
break;
210+
}
211+
case "-v":
212+
case "--version":
213+
{
214+
Write(InstallerVersion);
178215
break;
179216
}
180217
case "list-lua":
@@ -284,12 +321,15 @@ private static int Main(string[] args)
284321

285322
if (installed)
286323
{
287-
Write("Lua was installed successfully.");
324+
Write("Lua was installed successfully:");
288325
Write(string.Format(" Lua version: {0}", installArgs.Version.Version));
289326
Write(string.Format(" Architecture: {0}", installArgs.Arch.ToString()));
290327
Write(string.Format(" Destination: {0}", installArgs.OutDir));
291328
Write(string.Format(" Visual Studio: {0}", installArgs.Vs.Version.ToString()));
292329
Write(string.Format(" Windows SDK: {0}", installArgs.Winsdk.Version.ToString()));
330+
Write("LuaInstaller.Console:");
331+
Write(string.Format(" Version: {0}", InstallerVersion));
332+
Write(string.Format(" Website: {0}", InstallerWebsite));
293333
}
294334

295335
return result;

LuaInstaller.Console/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// set of attributes. Change these attribute values to modify the information
77
// associated with an assembly.
88
[assembly: AssemblyTitle("LuaInstaller.Console")]
9-
[assembly: AssemblyDescription("")]
10-
[assembly: AssemblyConfiguration("")]
9+
[assembly: AssemblyDescription("Easy way to download, build and install Lua on Windows from the command line.")]
10+
[assembly: AssemblyConfiguration("Release")]
1111
[assembly: AssemblyCompany("luau-project")]
1212
[assembly: AssemblyProduct("LuaInstaller.Console")]
1313
[assembly: AssemblyCopyright("Copyright © 2017 - 2024 luau-project")]

LuaInstaller.Core/LuaInstaller.Core.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
66
<CheckEolTargetFramework>false</CheckEolTargetFramework>
77
<Title>LuaInstaller.Core</Title>
8+
<Description>A library to ease the task to download, build and install Lua on Windows.</Description>
89
<Copyright>Copyright © 2017 - 2024 luau-project</Copyright>
910
<Version>0.5.0.0</Version>
1011
<Authors>luau-project</Authors>

LuaInstaller.Core/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// set of attributes. Change these attribute values to modify the information
77
// associated with an assembly.
88
[assembly: AssemblyTitle("LuaInstaller.Core")]
9-
[assembly: AssemblyDescription("")]
10-
[assembly: AssemblyConfiguration("")]
9+
[assembly: AssemblyDescription("A library to ease the task to download, build and install Lua on Windows.")]
10+
[assembly: AssemblyConfiguration("Release")]
1111
[assembly: AssemblyCompany("luau-project")]
1212
[assembly: AssemblyProduct("LuaInstaller.Core")]
1313
[assembly: AssemblyCopyright("Copyright © 2017 - 2024 luau-project")]
264 KB
Binary file not shown.

LuaInstaller/LuaInstaller.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@
1010
<UseWPF>true</UseWPF>
1111
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
1212
<Title>LuaInstaller</Title>
13+
<Description>Easy way to download, build and install Lua on Windows.</Description>
1314
<Copyright>Copyright © 2017 - 2024 luau-project</Copyright>
1415
<Version>0.5.0.0</Version>
1516
<Authors>luau-project</Authors>
1617
<Company>luau-project</Company>
1718
<AssemblyVersion>0.5.0.0</AssemblyVersion>
1819
<FileVersion>0.5.0.0</FileVersion>
1920
<RuntimeIdentifiers>win-x64;win-x86</RuntimeIdentifiers>
21+
<ApplicationIcon>Assets\LuaInstaller-256x256.ico</ApplicationIcon>
22+
<PackageProjectUrl>https://github.com/luau-project/LuaInstaller</PackageProjectUrl>
23+
<RepositoryUrl>https://github.com/luau-project/LuaInstaller</RepositoryUrl>
2024
</PropertyGroup>
2125

2226
</Project>

LuaInstaller/MainWindow.xaml

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
xmlns:vm="clr-namespace:LuaInstaller.ViewModels"
88
xmlns:converters="clr-namespace:LuaInstaller.Converters"
99
mc:Ignorable="d"
10-
Title="Lua Installer" Height="350" Width="525">
10+
Title="Lua Installer" Width="550" Height="450" MinWidth="550" MinHeight="450">
1111
<Window.Resources>
1212
<vm:LuaInstallerViewModel x:Key="viewModel"/>
1313
<converters:ArchitectureConverter x:Key="archConverter"/>
@@ -28,25 +28,47 @@
2828
</StatusBarItem>
2929
</StatusBar>
3030

31+
<Expander DockPanel.Dock="Bottom" Margin="20,0" Padding="0,20,0,0">
32+
<Expander.Header>Installer information</Expander.Header>
33+
<Grid>
34+
<Grid.ColumnDefinitions>
35+
<ColumnDefinition Width="*"/>
36+
<ColumnDefinition Width="*"/>
37+
</Grid.ColumnDefinitions>
38+
<Grid.RowDefinitions>
39+
<RowDefinition Height="Auto"/>
40+
<RowDefinition Height="5"/>
41+
<RowDefinition Height="Auto"/>
42+
<RowDefinition Height="5"/>
43+
</Grid.RowDefinitions>
44+
45+
<Label Grid.Column="0" Grid.Row="0" Content="Version"/>
46+
<TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding InstallerVersion}" VerticalAlignment="Center" />
47+
48+
<Label Grid.Column="0" Grid.Row="2" Content="Website"/>
49+
<TextBox Grid.Column="1" Grid.Row="2" IsReadOnly="True" VerticalContentAlignment="Center" Text="https://github.com/luau-project/LuaInstaller"/>
50+
</Grid>
51+
</Expander>
52+
3153
<Grid IsEnabled="{Binding InstallCommand.NotInstalling, Source={StaticResource viewModel}}" Margin="20,10">
3254
<Grid.ColumnDefinitions>
3355
<ColumnDefinition Width="*"/>
3456
<ColumnDefinition Width="*"/>
3557
</Grid.ColumnDefinitions>
3658
<Grid.RowDefinitions>
37-
<RowDefinition Height="*"/>
59+
<RowDefinition Height="Auto"/>
3860
<RowDefinition Height="5"/>
39-
<RowDefinition Height="*"/>
61+
<RowDefinition Height="Auto"/>
4062
<RowDefinition Height="5"/>
41-
<RowDefinition Height="*"/>
63+
<RowDefinition Height="Auto"/>
4264
<RowDefinition Height="5"/>
43-
<RowDefinition Height="*"/>
65+
<RowDefinition Height="Auto"/>
4466
<RowDefinition Height="5"/>
45-
<RowDefinition Height="*"/>
67+
<RowDefinition Height="Auto"/>
4668
<RowDefinition Height="5"/>
47-
<RowDefinition Height="*"/>
69+
<RowDefinition Height="Auto"/>
4870
<RowDefinition Height="5"/>
49-
<RowDefinition Height="*"/>
71+
<RowDefinition Height="Auto"/>
5072
</Grid.RowDefinitions>
5173

5274
<Label Grid.Column="0" Grid.Row="0" Content="Platform"/>
@@ -87,14 +109,17 @@
87109
</DataTemplate>
88110
</ComboBox.ItemTemplate>
89111
</ComboBox>
90-
91-
<CheckBox Grid.Column="1" Grid.Row="10" VerticalContentAlignment="Center" Content="Set environment variables" IsChecked="{Binding SetEnvironmentVariables}"/>
92112

93-
<StackPanel IsEnabled="{Binding SetEnvironmentVariables}" Grid.Column="1" Grid.Row="12" Orientation="Horizontal">
113+
<CheckBox Grid.Column="1" Grid.Row="10" VerticalContentAlignment="Center" Content="Set environment variables" IsChecked="{Binding SetEnvironmentVariables}" ToolTipService.InitialShowDelay="200" Margin="0,5,0,0">
114+
<CheckBox.ToolTip>
115+
<TextBlock Text="To set environment variables, you must &quot;Run as Administrator&quot;"/>
116+
</CheckBox.ToolTip>
117+
</CheckBox>
118+
119+
<StackPanel IsEnabled="{Binding SetEnvironmentVariables}" Grid.Column="1" Grid.Row="12" Orientation="Horizontal" Margin="0,5">
94120
<RadioButton Margin="20,0,10,0" Content="User" IsChecked="{Binding VariableTarget, Converter={StaticResource varTargetConverter}, ConverterParameter=User}"/>
95121
<RadioButton Content="Machine" IsChecked="{Binding VariableTarget, Converter={StaticResource varTargetConverter}, ConverterParameter=Machine}"/>
96122
</StackPanel>
97-
98123
</Grid>
99124

100125
</DockPanel>

LuaInstaller/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// set of attributes. Change these attribute values to modify the information
99
// associated with an assembly.
1010
[assembly: AssemblyTitle("LuaInstaller")]
11-
[assembly: AssemblyDescription("")]
12-
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyDescription("Easy way to download, build and install Lua on Windows.")]
12+
[assembly: AssemblyConfiguration("Release")]
1313
[assembly: AssemblyCompany("luau-project")]
1414
[assembly: AssemblyProduct("LuaInstaller")]
1515
[assembly: AssemblyCopyright("Copyright © 2017 - 2024 luau-project")]

LuaInstaller/ViewModels/LuaInstallerViewModel.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using LuaInstaller.Commands;
22
using LuaInstaller.Core;
33
using System;
4-
using System.Collections.Generic;
54
using System.Collections.ObjectModel;
65
using System.ComponentModel;
6+
using System.Diagnostics;
77
using System.IO;
8-
using System.Linq;
8+
using System.Reflection;
99

1010
namespace LuaInstaller.ViewModels
1111
{
@@ -266,6 +266,16 @@ public EnvironmentVariableTarget VariableTarget
266266
}
267267
}
268268

269+
public string InstallerVersion
270+
{
271+
get
272+
{
273+
Assembly assembly = Assembly.GetExecutingAssembly();
274+
FileVersionInfo assemblyInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
275+
return assemblyInfo.FileVersion;
276+
}
277+
}
278+
269279
public LuaInstallerViewModel()
270280
{
271281
components = new InstalledComponents();

0 commit comments

Comments
 (0)