Skip to content

Commit 807db4e

Browse files
author
Albert Møller Nielsen
committed
Hotfix 1.0.
1 parent d06fa57 commit 807db4e

File tree

15 files changed

+35
-39
lines changed

15 files changed

+35
-39
lines changed
-194 KB
Binary file not shown.
-194 KB
Binary file not shown.
Binary file not shown.

Advanced Installer/Advanced Installer.aip

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<COMPONENT cid="caphyon.advinst.msicomp.MsiPropsComponent">
77
<ROW Property="AI_BITMAP_DISPLAY_MODE" Value="0"/>
88
<ROW Property="AI_FINDEXE_TITLE" Value="Select the installation package for [|ProductName]" ValueLocId="AI.Property.FindExeTitle"/>
9-
<ROW Property="AI_PROPPATH_DIR_PERBUILD_AssistantComputerControl.exe" Value="..\AssistantComputerControl\bin\Debug"/>
10-
<ROW Property="AI_PROPPATH_DIR_PERBUILD_AssistantComputerControl.exe.config" Value="..\AssistantComputerControl\bin\Debug"/>
9+
<ROW Property="AI_PROPPATH_DIR_PERBUILD_AssistantComputerControl.exe" Value="..\AssistantComputerControl\bin\Release"/>
10+
<ROW Property="AI_PROPPATH_DIR_PERBUILD_AssistantComputerControl.exe.config" Value="..\AssistantComputerControl\bin\Release"/>
1111
<ROW Property="AI_PROPPATH_DIR_PERBUILD_Microsoft.WindowsAPICodePack.Shell.dll" Value="..\packages\Microsoft.WindowsAPICodePack.Shell.1.1.0\lib"/>
1212
<ROW Property="AI_PROPPATH_DIR_PERBUILD_Microsoft.WindowsAPICodePack.dll" Value="..\packages\Microsoft.WindowsAPICodePack.Core.1.1.0\lib"/>
1313
<ROW Property="AI_PROPPATH_DIR_PERBUILD_Newtonsoft.Json.dll" Value="..\packages\Newtonsoft.Json.11.0.2\lib\net45"/>
@@ -25,10 +25,10 @@
2525
<ROW Property="BannerBitmap" Value="banner" MultiBuildValue="DefaultBuild:banner.png" Type="1" MsiKey="BannerBitmap"/>
2626
<ROW Property="DialogBitmap" Value="dialog" MultiBuildValue="DefaultBuild:dialogbitmap.png" Type="1" MsiKey="DialogBitmap"/>
2727
<ROW Property="Manufacturer" Value="Albert MN."/>
28-
<ROW Property="ProductCode" Value="1033:{87C479BC-430D-4256-B65E-A5C8891D8199} " Type="16"/>
28+
<ROW Property="ProductCode" Value="1033:{7DF2BB2F-E945-4D1D-8D0A-5D3DC10FBC70} " Type="16"/>
2929
<ROW Property="ProductLanguage" Value="1033"/>
3030
<ROW Property="ProductName" Value="AssistantComputerControl"/>
31-
<ROW Property="ProductVersion" Value="1.0.0" Type="32"/>
31+
<ROW Property="ProductVersion" Value="1.0.1" Type="32"/>
3232
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/>
3333
<ROW Property="UpgradeCode" Value="{8E6F4399-B513-420B-8E11-36837A8550EE}"/>
3434
<ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/>

AssistantComputerControl/ACC_Updater.cs

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,15 @@ public bool Check() {
7575
//Couldn't reach "latest" update, but beta-updates are enabled
7676
latestBeta = JsonConvert.DeserializeObject<Version>(latestBetaJson);
7777

78-
if (DateTime.Parse(latestBeta.datetime) > DateTime.Parse(MainProgram.releaseDate)) {
79-
//Newer build
80-
newVersion = latestBeta;
81-
} else {
82-
//Not new, move on
83-
MainProgram.DoDebug("Software up to date (beta program enabled)");
84-
return false;
78+
if(latestBeta != null) {
79+
if (DateTime.Parse(latestBeta.datetime) > DateTime.Parse(MainProgram.releaseDate)) {
80+
//Newer build
81+
newVersion = latestBeta;
82+
} else {
83+
//Not new, move on
84+
MainProgram.DoDebug("Software up to date (beta program enabled)");
85+
return false;
86+
}
8587
}
8688
} else {
8789
MainProgram.DoDebug("Both release and beta is NULL, no new updates, or no contact to the server.");
@@ -93,14 +95,10 @@ public bool Check() {
9395
DialogResult dialogResult = MessageBox.Show("A new version of " + MainProgram.messageBoxTitle + " is available (v" + newVersion.version + " [" + newVersion.type + "]), do you wish to install it?", "New update found | " + MainProgram.messageBoxTitle, MessageBoxButtons.YesNo);
9496
if (dialogResult == DialogResult.Yes) {
9597
MainProgram.DoDebug("User chose \"yes\" to install update");
96-
Install(newVersion.installpath);
98+
DownloadFile(newVersion.installpath + "&upgrade=true");
9799
} else if (dialogResult == DialogResult.No) {
98100
MainProgram.DoDebug("User did not want to install update");
99101
}
100-
101-
if (File.Exists(Path.Combine(MainProgram.dataFolderLocation, "updated.txt"))) {
102-
File.Delete("updated.txt");
103-
}
104102
return true;
105103
} else {
106104
MainProgram.DoDebug("Software up to date");
@@ -162,14 +160,5 @@ private static void FileDownloadedCallback(object sender, AsyncCompletedEventArg
162160
MessageBox.Show("Failed to download new version. Try again later!", "Error | " + MainProgram.messageBoxTitle);
163161
}
164162
}
165-
166-
public void Install(string installPath) {
167-
MainProgram.DoDebug("Installing new version...");
168-
if (File.Exists(Path.Combine(MainProgram.dataFolderLocation, "updated.txt"))) {
169-
File.Delete("updated.txt");
170-
}
171-
172-
DownloadFile(installPath);
173-
}
174163
}
175164
}

AssistantComputerControl/MainProgram.cs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
namespace AssistantComputerControl {
1414
class MainProgram {
15-
public const string softwareVersion = "1.0.0",
16-
releaseDate = "2018-07-19 12:00",
15+
public const string softwareVersion = "1.0.1",
16+
releaseDate = "2018-07-20 16:59",
1717
appName = "AssistantComputerControl";
1818
static public bool debug = true,
1919
unmuteVolumeChange = true,
@@ -47,15 +47,16 @@ public enum TestStatus {
4747
[STAThread]
4848
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
4949
static void Main(string[] args) {
50+
SetupDataFolder();
51+
if (File.Exists(logFilePath))
52+
File.WriteAllText(logFilePath, string.Empty);
53+
5054
//Check if software already runs, if so kill this instance
5155
if (Process.GetProcessesByName(Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location)).Length > 1) {
5256
DoDebug("ACC is already running, killing this proccess");
5357
MessageBox.Show("ACC is already running.", "Already running | " + messageBoxTitle + "");
5458
Process.GetCurrentProcess().Kill();
5559
}
56-
SetupDataFolder();
57-
if(File.Exists(logFilePath))
58-
File.WriteAllText(logFilePath, string.Empty);
5960

6061
DoDebug("[ACC begun (v" + softwareVersion + ")]");
6162
AnalyticsSettings.SetupAnalyticsAsync();
@@ -191,6 +192,7 @@ public static string GetDropboxFolder() {
191192
string infoPath = @"Dropbox\info.json";
192193
string jsonPath = Path.Combine(Environment.GetEnvironmentVariable("LocalAppData"), infoPath);
193194

195+
if (!Directory.Exists(Directory.GetDirectoryRoot(jsonPath))) return "";
194196
if (!File.Exists(jsonPath)) jsonPath = Path.Combine(Environment.GetEnvironmentVariable("AppData"), infoPath);
195197
if (!File.Exists(jsonPath)) return "";
196198

@@ -268,14 +270,14 @@ public static string CheckPath() {
268270
path = Properties.Settings.Default.ActionFilePath;
269271
} else {
270272
string dropboxFolder = GetDropboxFolder();
271-
if (dropboxFolder == "" || !Directory.Exists(dropboxFolder)) {
272-
if (!Properties.Settings.Default.HasCompletedTutorial) {
273+
if (dropboxFolder == "" || dropboxFolder == null || !Directory.Exists(dropboxFolder)) {
274+
/*if (Properties.Settings.Default.HasCompletedTutorial) {
273275
//Dropbox not found & no custom filepath, go through setup again?
274276
var msgBox = MessageBox.Show("Dropbox (required) doesn't seem to be installed... Do you want to go through the setup guide again?", "[ERROR] No folder specified | " + messageBoxTitle, MessageBoxButtons.YesNo);
275277
if (msgBox == DialogResult.Yes) {
276278
ShowGettingStarted();
277279
}
278-
}
280+
}*/
279281
} else {
280282
string dropboxACCpath = dropboxFolder + @"\AssistantComputerControl";
281283
if (!Directory.Exists(dropboxACCpath)) {
@@ -290,9 +292,11 @@ public static string CheckPath() {
290292
}
291293

292294
public static void DoDebug(string str) {
293-
File.AppendAllText(logFilePath, DateTime.Now.ToString() + ": " + str + Environment.NewLine);
294-
if (debug) {
295-
Console.WriteLine(str);
295+
if (str != null && File.Exists(logFilePath)) {
296+
File.AppendAllText(logFilePath, DateTime.Now.ToString() + ": " + str + Environment.NewLine);
297+
if (debug) {
298+
Console.WriteLine(str);
299+
}
296300
}
297301
}
298302

AssistantComputerControl/SettingsForm.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Diagnostics;
3+
using System.Threading;
34
using System.Windows.Forms;
45

56
namespace AssistantComputerControl {
@@ -79,9 +80,11 @@ private void betaProgram_CheckedChanged(object sender, EventArgs e) {
7980
Properties.Settings.Default.BetaProgram = betaProgram.Checked;
8081
Properties.Settings.Default.Save();
8182

82-
if (betaProgram.Checked) {
83-
new ACC_Updater().Check();
84-
}
83+
new Thread(() => {
84+
if (betaProgram.Checked) {
85+
new ACC_Updater().Check();
86+
}
87+
}).Start();
8588
}
8689
}
8790

0 Bytes
Binary file not shown.
-512 Bytes
Binary file not shown.
-512 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)