Skip to content

Commit fee59cc

Browse files
author
Albert Møller Nielsen
committed
fixing fuckup
2 parents a5c87a5 + 5aa5689 commit fee59cc

29 files changed

+205
-76
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# User-specific files (MonoDevelop/Xamarin Studio)
1313
*.userprefs
1414

15+
AssistantComputerControl/AnalyticsSettings.cs
1516
# Build results
1617
[Dd]ebug/
1718
[Dd]ebugPublic/
@@ -328,4 +329,4 @@ ASALocalRun/
328329
*.nvuser
329330

330331
# MFractors (Xamarin productivity tool) working folder
331-
.mfractor/
332+
.mfractor/
0 Bytes
Binary file not shown.

Advanced Installer/Advanced Installer.aip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<ROW Property="AI_PROPPATH_FILENAME_PERBUILD_System.Collections.Immutable.dll" Value="System.Collections.Immutable.dll"/>
2727
<ROW Property="AI_ThemeStyle" Value="aero" MsiKey="AI_ThemeStyle"/>
2828
<ROW Property="ALLUSERS" Value="1"/>
29-
<ROW Property="ARPCOMMENTS" Value="The software that lets you control your computer using your assistants (Amazon Alexa or Google Assistant)" ValueLocId="*"/>
29+
<ROW Property="ARPCOMMENTS" Value="The software that lets you control your computer using your personal assistants (Amazon Alexa or Google Assistant)" ValueLocId="*"/>
3030
<ROW Property="ARPCONTACT" Value="https://twitter.com/ACC_HomeAlexa"/>
3131
<ROW Property="ARPHELPLINK" Value="https://acc.albe.pw/#get-in-touch"/>
3232
<ROW Property="ARPNOMODIFY" MultiBuildValue="DefaultBuild:1"/>
@@ -37,10 +37,10 @@
3737
<ROW Property="BannerBitmap" Value="banner" MultiBuildValue="DefaultBuild:banner.png" Type="1" MsiKey="BannerBitmap"/>
3838
<ROW Property="DialogBitmap" Value="dialog" MultiBuildValue="DefaultBuild:dialogbitmap.png" Type="1" MsiKey="DialogBitmap"/>
3939
<ROW Property="Manufacturer" Value="Albert MN."/>
40-
<ROW Property="ProductCode" Value="1033:{759BA58E-9896-49F2-B2C0-D8685040C505} " Type="16"/>
40+
<ROW Property="ProductCode" Value="1033:{C7450E85-3B70-43E5-8B80-14073ECA4E1A} " Type="16"/>
4141
<ROW Property="ProductLanguage" Value="1033"/>
4242
<ROW Property="ProductName" Value="AssistantComputerControl"/>
43-
<ROW Property="ProductVersion" Value="1.1.1" Type="32"/>
43+
<ROW Property="ProductVersion" Value="1.1.3.8" Type="32"/>
4444
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/>
4545
<ROW Property="UpgradeCode" Value="{8E6F4399-B513-420B-8E11-36837A8550EE}"/>
4646
<ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/>

Advanced Installer/Advanced Installer.aiproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<OutputsToImport>PrimaryOutput;References</OutputsToImport>
3131
</ProjectReference>
3232
</ItemGroup>
33-
<Import Condition="'$(AdvancedInstallerMSBuildTargets)' != ''" Project="$(AdvancedInstallerMSBuildTargets)\AdvInstExtTasks.Targets" />
34-
<Import Condition="'$(AdvancedInstallerMSBuildTargets)' == ''" Project="$(MSBuildExtensionsPath32)\Caphyon\Advanced Installer\AdvInstExtTasks.Targets" />
33+
<Target Name="Build">
34+
<Error Text="This project requires Advanced Installer tool. Please download it from https://www.advancedinstaller.com/download.html" />
35+
</Target>
36+
<Import Project="$(AdvancedInstallerMSBuildTargets)\AdvInstExtTasks.Targets" Condition="'$(AdvancedInstallerMSBuildTargets)' != ''" />
37+
<Import Project="$(MSBuildExtensionsPath32)\Caphyon\Advanced Installer\AdvInstExtTasks.Targets" Condition="('$(AdvancedInstallerMSBuildTargets)' == '') And (Exists('$(MSBuildExtensionsPath32)\Caphyon\Advanced Installer\AdvInstExtTasks.Targets'))" />
3538
</Project>

AssistantComputerControl/ACC_Updater.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ACC_Updater {
1212
private const string releaseJsonUrl = "http://acc.albe.pw/versions/latest_version.php?type=release";
1313
private const string betaJsonUrl = "http://acc.albe.pw/versions/latest_version.php?type=beta";
1414

15-
public bool Check() {
15+
public bool Check(bool debug = false) {
1616
if (MainProgram.isCheckingForUpdate)
1717
return false;
1818

@@ -64,6 +64,8 @@ public bool Check() {
6464
} else {
6565
//None of them are newer. Nothing new
6666
MainProgram.DoDebug("Software up to date (beta program enabled)");
67+
68+
MainProgram.isCheckingForUpdate = false;
6769
return false;
6870
}
6971
} else if (latestReleaseJson != null && latestBetaJson == null) {
@@ -76,6 +78,7 @@ public bool Check() {
7678
} else {
7779
//Not new, move on
7880
MainProgram.DoDebug("Software up to date");
81+
MainProgram.isCheckingForUpdate = false;
7982
return false;
8083
}
8184
} else if (latestReleaseJson == null && latestBetaJson != null) {
@@ -89,6 +92,7 @@ public bool Check() {
8992
} else {
9093
//Not new, move on
9194
MainProgram.DoDebug("Software up to date (beta program enabled)");
95+
MainProgram.isCheckingForUpdate = false;
9296
return false;
9397
}
9498
}
@@ -106,13 +110,19 @@ public bool Check() {
106110
} else if (dialogResult == DialogResult.No) {
107111
MainProgram.DoDebug("User did not want to install update");
108112
}
113+
MainProgram.isCheckingForUpdate = false;
109114
return true;
110115
} else {
111116
MainProgram.DoDebug("Software up to date");
117+
if (debug)
118+
MessageBox.Show("No new update found. You're up to date!", "Check for update | " + MainProgram.messageBoxTitle);
112119
}
113120
} else {
114121
MainProgram.DoDebug("Could not reach the webserver (both 'release' and 'beta' json files couldn't be reached)");
122+
if (debug)
123+
MessageBox.Show("Could not reach the ACC webservers - try again later", "Check for update | " + MainProgram.messageBoxTitle);
115124
}
125+
MainProgram.isCheckingForUpdate = false;
116126
return false;
117127
}
118128

AssistantComputerControl/AboutVersionWeb/index.html

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
<img style="width:125px;position:fixed;bottom:0;left:0;margin-left:20px;" src="assets/acc_logo.png">
2424
</div>
2525
<div class="col-9">
26-
<b>Version 1.1.0</b>
26+
<b>Version 1.1.3</b>
2727
<ul>
28-
<li><b>Released:</b> 27-09-2018</li>
28+
<li><b>Released:</b> 11-11-2018</li>
2929
</ul>
3030
<p>
3131
<a target="_blank" href="https://acc.albe.pw/">Website</a> |
@@ -36,7 +36,20 @@
3636
<b>New this version;</b>
3737
<div class="scroller card card-body">
3838
<ul>
39-
<li><b>8 new actions</b>
39+
<li><i>Hotfix 1.1.3 fixes;</i></li>
40+
<ul>
41+
<li>Fixed endless shutdown error where PC would shut down when it started</li>
42+
<li>Minor bug-fixes</li>
43+
<li>Performance improvements</li>
44+
</ul>
45+
<li><i>Hotfix 1.1.2 fixes;</i></li>
46+
<ul>
47+
<li>Fixed bug where ACC didn't detect Dropbox if you had Dropbox Business</li>
48+
<li>Fixed "Setup Guide" bug where it tricked you to think you had Dropbox even if you didn't</li>
49+
<li>Fixed endless loop of popups that showed when Dropbox wasn't installed</li>
50+
<li>And a bunch of other crash/bug-fixes as well</li>
51+
</ul>
52+
<li><b>Version 1.1.0: 8 new actions</b>
4053
<ul>
4154
<li><i>Enable them all <a target="_blank" href="https://acc.albe.pw/?sortBy=newest#what-can-it-do">here</a></i></li>
4255
<li><code>write_out</code>: speech to text! Say a phrase, and it will be written out in the focused text field</li>

AssistantComputerControl/AnalyticsSettings.cs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Net.Http;
44
using System.Net.Http.Headers;
@@ -66,7 +66,7 @@ public static void UpdateSharing(bool doShare) {
6666

6767
SetupAnalytics();
6868
}
69-
69+
7070
public static void SetupAnalytics() {
7171
//Unique user-ID
7272
if (Properties.Settings.Default.UID == "" || Properties.Settings.Default.UID == null) {
@@ -97,12 +97,12 @@ public static void SetupAnalytics() {
9797

9898
//Populate new analytics array with old values
9999
int i = 0;
100-
foreach(int ac in oldSettings) {
100+
foreach (int ac in oldSettings) {
101101
if (i != newSettings.Length)
102102
newSettings[i] = ac;
103103
i++;
104104
}
105-
105+
106106
Properties.Settings.Default.TotalActionsExecuted = newSettings;
107107
Properties.Settings.Default.Save();
108108
}
@@ -149,13 +149,17 @@ public static void AddCount(string action, string type) {
149149
int pos = Array.IndexOf(actions, action);
150150
if (pos > -1) {
151151
//MainProgram.DoDebug("Added +1 to " + action + " at pos " + pos);
152-
Properties.Settings.Default.TotalActionsExecuted[pos]++;
152+
if (Properties.Settings.Default.TotalActionsExecuted.Length >= pos) {
153+
Properties.Settings.Default.TotalActionsExecuted[pos]++;
153154

154-
if (!Properties.Settings.Default.AnalyticsUnsentData) {
155-
Properties.Settings.Default.AnalyticsUnsentData = true;
156-
ScheduleAnalyticsSend();
155+
if (!Properties.Settings.Default.AnalyticsUnsentData) {
156+
Properties.Settings.Default.AnalyticsUnsentData = true;
157+
ScheduleAnalyticsSend();
158+
}
159+
Properties.Settings.Default.Save();
160+
} else {
161+
MainProgram.DoDebug("Index " + pos.ToString() + " exceeds 'TotalActionsExecuted' property, which has length; " + Properties.Settings.Default.TotalActionsExecuted.Length.ToString());
157162
}
158-
Properties.Settings.Default.Save();
159163
} else {
160164
MainProgram.DoDebug("Could not find action \"" + action + "\" in action-array (analytics)");
161165
}
@@ -229,7 +233,7 @@ public static string SendAnalyticsData() {
229233
["beta_program"] = Properties.Settings.Default.BetaProgram ? "true" : "false",
230234
["date"] = Properties.Settings.Default.AnalyticsThisDay
231235
};
232-
236+
233237
try {
234238
var response = client.PostAsync(sendDataUrl, new FormUrlEncodedContent(parameters)).Result;
235239
var contents = response.Content.ReadAsStringAsync().Result;

AssistantComputerControl/AssistantComputerControl.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
3636
<WebPage>publish.htm</WebPage>
3737
<ApplicationRevision>0</ApplicationRevision>
38-
<ApplicationVersion>1.1.0.%2a</ApplicationVersion>
38+
<ApplicationVersion>1.1.3.%2a</ApplicationVersion>
3939
<UseApplicationTrust>false</UseApplicationTrust>
4040
<CreateDesktopShortcut>true</CreateDesktopShortcut>
4141
<PublishWizardCompleted>true</PublishWizardCompleted>
@@ -151,6 +151,7 @@
151151
</Compile>
152152
<Compile Include="AnalyticsSettings.cs" />
153153
<Compile Include="AudioManager.cs" />
154+
<Compile Include="FlashWindow.cs" />
154155
<Compile Include="GettingStarted.cs">
155156
<SubType>Form</SubType>
156157
</Compile>

AssistantComputerControl/GettingStarted.cs

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public GettingStarted(int startTab = 0) {
4141
tabControl.Selected += delegate {
4242
if (tabControl.SelectedIndex == 1) {
4343
//Clicked on recommended setup guide (HTML), can show "move on" popover now
44-
theWebBrowser.Document.InvokeScript("showHelpPopover");
44+
//theWebBrowser.Document.InvokeScript("showHelpPopover"); // Why would I do this...?
4545
} else if (tabControl.SelectedIndex == 2) {
4646
expert.Focus();
4747
}
@@ -161,12 +161,31 @@ void FreakingStopDingSound(Object o, KeyEventArgs e) {
161161
MainProgram.testingAction = false;
162162
MainProgram.gettingStarted = null;
163163
};
164+
165+
166+
this.HandleCreated += delegate {
167+
Invoke(new Action(() => {
168+
FlashWindow.Flash(this);
169+
if (Application.OpenForms[this.Name] != null) {
170+
Application.OpenForms[this.Name].Activate();
171+
Application.OpenForms[this.Name].Focus();
172+
}
173+
}));
174+
};
164175
}
165176

166177
public void SendActionThrough(Object[] objArray) {
167178
if ((string)objArray[0] == "success") {
168179
SetupDone();
169180
}
181+
this.Invoke(new Action(() => {
182+
FlashWindow.Flash(this);
183+
if (Application.OpenForms[this.Name] != null) {
184+
Application.OpenForms[this.Name].Activate();
185+
Application.OpenForms[this.Name].Focus();
186+
}
187+
}));
188+
170189
theWebBrowser.Invoke(new Action(() => {
171190
theWebBrowser.Document.InvokeScript("actionWentThrough", objArray);
172191
}));
@@ -212,12 +231,16 @@ private void BrowserDocumentCompleted(object sender, WebBrowserDocumentCompleted
212231
void link_MouseUp(object sender, HtmlElementEventArgs e) {
213232
Regex pattern = new Regex("href=\\\"(.+?)\\\"");
214233
Match match = pattern.Match((sender as HtmlElement).OuterHtml);
215-
string link = match.Groups[1].Value;
216-
217-
if (link[0] != '#')
218-
Process.Start(link);
219-
else if (link == "#recommendedFinished") {
220-
tabControl.SelectTab(3);
234+
if (match.Groups.Count >= 1) {
235+
string link = match.Groups[1].Value;
236+
237+
if (link.Length > 0) {
238+
if (link[0] != '#')
239+
Process.Start(link);
240+
else if (link == "#recommendedFinished") {
241+
tabControl.SelectTab(3);
242+
}
243+
}
221244
}
222245
}
223246
private void NewBrowserWindow(object sender, CancelEventArgs e) {
@@ -286,7 +309,9 @@ private void SetupDone() {
286309
MainProgram.DoDebug("Starting with Windows now");
287310
}
288311
Properties.Settings.Default.AnalyticsInformed = true;
289-
AnalyticsSettings.UpdateSharing(analyticsEnabledBox.Checked);
312+
if (Properties.Settings.Default.SendAnonymousAnalytics != analyticsEnabledBox.Checked) {
313+
AnalyticsSettings.UpdateSharing(analyticsEnabledBox.Checked);
314+
}
290315

291316
MainProgram.DoDebug("Anonymous analyitcs " + (analyticsEnabledBox.Checked ? "IS" : "is NOT") + " enabled");
292317

AssistantComputerControl/MainProgram.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@
1414

1515
namespace AssistantComputerControl {
1616
class MainProgram {
17-
public const string softwareVersion = "1.1.0",
18-
releaseDate = "2018-10-08 23:30:00", //YYYY-MM-DD H:i:s - otherwise it gives an error
17+
public const string softwareVersion = "1.1.3",
18+
releaseDate = "2018-11-12 20:30:00", //YYYY-MM-DD H:i:s - otherwise it gives an error
1919
appName = "AssistantComputerControl";
2020
static public bool debug = true,
2121
unmuteVolumeChange = true,
2222
isCheckingForUpdate = false,
2323

2424
testingAction = false,
25-
aboutVersionAwaiting = false;
25+
aboutVersionAwaiting = false,
26+
hasAskedForSetupAgain = false;
2627

2728
public TestStatus currentTestStatus = TestStatus.ongoing;
2829
public enum TestStatus {
@@ -56,7 +57,7 @@ public enum TestStatus {
5657
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
5758
static void Main(string[] args) {
5859
if (AnalyticsSettings.sentryToken != "super_secret") {
59-
//Tracking issues with Sentry.IO - not forked from GitHub, official version
60+
//Tracking issues with Sentry.IO - not forked from GitHub (official version)
6061
bool sentryOK = false;
6162
try {
6263
if (Properties.Settings.Default.UID != "") {
@@ -378,6 +379,8 @@ public static string GetDropboxFolder() {
378379
if (dropboxJson != null) {
379380
if (dropboxJson.personal != null) {
380381
return dropboxJson.personal.Path;
382+
} else if (dropboxJson.business != null) {
383+
return dropboxJson.business.Path;
381384
}
382385
}
383386
} catch {
@@ -475,8 +478,9 @@ public static string CheckPath() {
475478
} else {
476479
string dropboxFolder = GetDropboxFolder();
477480
if (dropboxFolder == "" || dropboxFolder == null || !Directory.Exists(dropboxFolder)) {
478-
if (Properties.Settings.Default.HasCompletedTutorial) {
481+
if (Properties.Settings.Default.HasCompletedTutorial && gettingStarted is null && !hasAskedForSetupAgain) {
479482
//Dropbox not found & no custom filepath, go through setup again?
483+
hasAskedForSetupAgain = true;
480484
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);
481485
if (msgBox == DialogResult.Yes) {
482486
ShowGettingStarted();
@@ -505,7 +509,7 @@ public static void DoDebug(string str) {
505509
Console.WriteLine(str);
506510
}
507511
} catch (Exception e) {
508-
Console.WriteLine("Failed to write to log, exception; " + e);
512+
Console.WriteLine("Failed to write to log, exception");
509513
}
510514
}
511515

0 commit comments

Comments
 (0)