Skip to content

Commit 8adce5e

Browse files
Installer now has a visual component and adds shortcut to desktop
1 parent f33c990 commit 8adce5e

File tree

7 files changed

+53
-6
lines changed

7 files changed

+53
-6
lines changed

.vs/imageResizer/v17/.suo

-512 Bytes
Binary file not shown.

imageResizer/AboutBox.Designer.cs

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

imageResizer/AboutBox.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,10 @@ private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
2424
{
2525
System.Diagnostics.Process.Start("mailto:borisonekenobi@gmail.com");
2626
}
27+
28+
private void AboutBox_Load(object sender, EventArgs e)
29+
{
30+
label5.Text = "Current: v" + Form1.CurrentVersion + "\nLatest: v" + Form1.LatestVersion;
31+
}
2732
}
2833
}

imageResizer/Form1.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ namespace imageResizer
99
public partial class Form1 : Form
1010
{
1111
private bool checkedVersion = false;
12+
public static Version CurrentVersion { get; set; }
13+
public static Version LatestVersion { get; set; }
1214
public Form1()
1315
{
1416
InitializeComponent();
@@ -179,10 +181,10 @@ private void Form1_Activated(object sender, EventArgs e)
179181
int major = int.Parse(versionNums[0].Split('v')[1]);
180182
int minor = int.Parse(versionNums[1]);
181183
int patch = int.Parse(versionNums[2]);
182-
Version latestVersion = new Version(major, minor, patch);
183-
Version version = new Version(System.Windows.Forms.Application.ProductVersion);
184+
LatestVersion = new Version(major, minor, patch);
185+
CurrentVersion = new Version(System.Windows.Forms.Application.ProductVersion);
184186

185-
if (latestVersion > version)
187+
if (LatestVersion > CurrentVersion)
186188
{
187189
if (MessageBox.Show(this, "A newer version of the software is available. Would you like to download it?", "New version available!", MessageBoxButtons.YesNo) == DialogResult.Yes)
188190
{

imageResizer/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("6.0.0")]
35-
[assembly: AssemblyFileVersion("6.0.0")]
34+
[assembly: AssemblyVersion("6.1.0")]
35+
[assembly: AssemblyFileVersion("6.1.0")]

imageResizerInstaller/Product.wxs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3-
<Product Id="*" Name="imageResizer" Language="1033" Version="6.0.0" Manufacturer="Boris Vasilev" UpgradeCode="d5f843f3-27cf-45a2-acd7-1ad08d67fe61">
3+
<Product Id="*" Name="imageResizer" Language="1033" Version="6.1.0" Manufacturer="Boris Vasilev" UpgradeCode="d5f843f3-27cf-45a2-acd7-1ad08d67fe61">
44
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64"/>
55

66
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
77
<MediaTemplate EmbedCab="yes"/>
88

99
<Feature Id="ProductFeature" Title="imageResizerInstaller" Level="1">
1010
<ComponentGroupRef Id="ProductComponents" />
11+
<ComponentRef Id="imageResizerShortcut" />
1112
</Feature>
1213
</Product>
1314

@@ -16,7 +17,25 @@
1617
<Directory Id="ProgramFiles64Folder">
1718
<Directory Id="INSTALLFOLDER" Name="imageResizer" />
1819
</Directory>
20+
<Directory Id="DesktopFolder" Name="Desktop">
21+
<Component Id="imageResizerShortcut" Guid="*">
22+
<Shortcut Id="imageResizerShortcutShortcut"
23+
Name="Image Resizer"
24+
Description="Resizer for your images"
25+
Target="[INSTALLFOLDER]imageResizer.exe"
26+
WorkingDirectory="INSTALLFOLDER"/>
27+
<RegistryValue
28+
Root="HKCU"
29+
Key="Software\imageResizer\imageResizer"
30+
Name="installed"
31+
Type="integer"
32+
Value="1"
33+
KeyPath="yes"/>
34+
</Component>
35+
</Directory>
1936
</Directory>
37+
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
38+
<UIRef Id="WixUI_InstallDir" />
2039
</Fragment>
2140

2241
<Fragment>

imageResizerInstaller/imageResizerInstaller.wixproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
3333
</ProjectReference>
3434
</ItemGroup>
35+
<ItemGroup>
36+
<WixExtension Include="WixUIExtension">
37+
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
38+
<Name>WixUIExtension</Name>
39+
</WixExtension>
40+
</ItemGroup>
3541
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
3642
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
3743
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">

0 commit comments

Comments
 (0)