Skip to content

Commit d3a5cb9

Browse files
authored
Merge pull request #106 from AlbertMN/devel
Update master to v1.4.4
2 parents ee73e58 + bf98264 commit d3a5cb9

30 files changed

+302
-116
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
##
44
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
55

6+
Advanced Installer/
7+
68
# User-specific files
79
*.suo
810
*.user
Binary file not shown.
Binary file not shown.
Binary file not shown.

Advanced Installer/Advanced Installer.aip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,17 @@
3434
<ROW Property="ARPCOMMENTS" Value="The software that lets you control your computer using your personal assistants (Amazon Alexa or Google Assistant)" ValueLocId="*"/>
3535
<ROW Property="ARPCONTACT" Value="https://twitter.com/ACC_HomeAlexa"/>
3636
<ROW Property="ARPHELPLINK" Value="https://assistantcomputercontrol.com/#get-in-touch"/>
37-
<ROW Property="ARPNOMODIFY" MultiBuildValue="DefaultBuild:1"/>
3837
<ROW Property="ARPNOREPAIR" MultiBuildValue="DefaultBuild:1"/>
3938
<ROW Property="ARPPRODUCTICON" Value="logo_ico.exe" Type="8"/>
4039
<ROW Property="ARPURLINFOABOUT" Value="https://assistantcomputercontrol.com/"/>
4140
<ROW Property="ARPURLUPDATEINFO" Value="https://assistantcomputercontrol.com/"/>
4241
<ROW Property="BannerBitmap" Value="banner" MultiBuildValue="DefaultBuild:banner.png" Type="1" MsiKey="BannerBitmap"/>
4342
<ROW Property="DialogBitmap" Value="dialog" MultiBuildValue="DefaultBuild:dialogbitmap.png" Type="1" MsiKey="DialogBitmap"/>
4443
<ROW Property="Manufacturer" Value="Albert MN."/>
45-
<ROW Property="ProductCode" Value="1033:{1AE13B1D-FE8D-4745-98E8-98C9B5DFCF38} " Type="16"/>
44+
<ROW Property="ProductCode" Value="1033:{2280A735-687B-4D3D-9313-02E3041F56A6} " Type="16"/>
4645
<ROW Property="ProductLanguage" Value="1033"/>
4746
<ROW Property="ProductName" Value="AssistantComputerControl"/>
48-
<ROW Property="ProductVersion" Value="1.4.2" Type="32"/>
47+
<ROW Property="ProductVersion" Value="1.4.4" Type="32"/>
4948
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/>
5049
<ROW Property="UpgradeCode" Value="{8E6F4399-B513-420B-8E11-36837A8550EE}"/>
5150
<ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/>
@@ -141,6 +140,7 @@
141140
<ROW File="Spanish.json" Component_="Danish.json" FileName="SPANIS~1.JSO|Spanish.json" Attributes="0" SourcePath="..\AssistantComputerControl\Translations\Spanish.json" SelfReg="false"/>
142141
<ROW File="PortugueseBrasil.json" Component_="Danish.json" FileName="PORTUG~1.JSO|Portuguese - Brasil.json" Attributes="0" SourcePath="..\AssistantComputerControl\Translations\Portuguese - Brasil.json" SelfReg="false"/>
143142
<ROW File="Dutch.json" Component_="Danish.json" FileName="DUTCH~1.JSO|Dutch.json" Attributes="0" SourcePath="..\AssistantComputerControl\Translations\Dutch.json" SelfReg="false"/>
143+
<ROW File="ActionTester.html" Component_="AboutVersion.html" FileName="ACTION~1.HTM|ActionTester.html" Attributes="0" SourcePath="..\AssistantComputerControl\WebFiles\ActionTester.html" SelfReg="false"/>
144144
</COMPONENT>
145145
<COMPONENT cid="caphyon.advinst.msicomp.AppPathsComponent">
146146
<ROW Name="AI_APPPATH_PERBUILD_AssistantComputerControl.exe" Path="[|AI_PROPPATH_DIR_PERBUILD_AssistantComputerControl.exe]\[|AI_PROPPATH_FILENAME_PERBUILD_AssistantComputerControl.exe]" Type="2" Content="0"/>

AssistantComputerControl/ActionMods.cs

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,28 @@ class ActionMods {
2626
//Check mod folder and init mods
2727
public static void CheckMods() {
2828
try {
29-
modActions = new Dictionary<string, string>();
30-
string[] dirs = Directory.GetDirectories(MainProgram.actionModsPath, "*", SearchOption.TopDirectoryOnly);
31-
32-
foreach (string dir in dirs) {
33-
string theFile = Path.Combine(dir, "info.json");
34-
if (File.Exists(theFile)) {
35-
//Info file exists - read it
36-
string fileContent = ReadInfoFile(theFile);
37-
if (fileContent != null) {
38-
ValidateAddMod(fileContent, dir);
29+
if (Directory.Exists(MainProgram.actionModsPath)) {
30+
//Action mods path exists
31+
modActions = new Dictionary<string, string>();
32+
string[] dirs = Directory.GetDirectories(MainProgram.actionModsPath, "*", SearchOption.TopDirectoryOnly);
33+
34+
foreach (string dir in dirs) {
35+
string theFile = Path.Combine(dir, "info.json");
36+
if (File.Exists(theFile)) {
37+
//Info file exists - read it
38+
string fileContent = ReadInfoFile(theFile);
39+
if (fileContent != null) {
40+
ValidateAddMod(fileContent, dir);
41+
} else {
42+
MainProgram.DoDebug("Failed to read info.json file at; " + dir);
43+
}
3944
} else {
40-
MainProgram.DoDebug("Failed to read info.json file at; " + dir);
45+
MainProgram.DoDebug("Invalid folder in action mods; '" + dir + "'. Doesn't contain an info.json file.");
4146
}
42-
} else {
43-
MainProgram.DoDebug("Invalid folder in action mods; '" + dir + "'. Doesn't contain an info.json file.");
4447
}
48+
} else {
49+
//Mod directory doesn't exist
50+
MainProgram.DoDebug("Can't check for mods as the folder doesn't exist");
4551
}
4652
} catch (Exception e) {
4753
Console.WriteLine("The process failed: {0}", e.ToString());

AssistantComputerControl/Actions.cs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* AssistantComputerControl
33
* Made by Albert MN.
4-
* Updated: v1.4.2, 12-12-2020
4+
* Updated: v1.4.4, 19-05-2021
55
*
66
* Use:
77
* - Functions for all the actions
@@ -1051,20 +1051,23 @@ public void MoveMouse(String parameter) {
10511051
public const int MOUSEEVENTF_MIDDLEDOWN = 0x20;
10521052
public const int MOUSEEVENTF_MIDDLEUP = 0x40;
10531053

1054-
public void MouseClick(string parameter = "", string secondaryParameter = "") {
1054+
public void MouseClick(string parameter = "") {
10551055
/*
10561056
* Action made by community member Joshua Miller (modified by Albert)
10571057
*/
10581058

1059+
string firstParameter = parameter != null && parameter != String.Empty ? ActionChecker.GetSecondaryParam(parameter)[0] : "",
1060+
secondParameter = parameter != null && parameter != String.Empty ? (ActionChecker.GetSecondaryParam(parameter).Length > 1 ? ActionChecker.GetSecondaryParam(parameter)[1] : null) : "";
1061+
10591062
int timesToClick = 1;
1060-
string type = "left";
1063+
string type = firstParameter;
10611064

1062-
if (parameter == String.Empty) {
1065+
if (firstParameter == String.Empty) {
10631066
type = "left";
10641067
}
10651068

1066-
if (secondaryParameter != String.Empty) {
1067-
if (Int32.TryParse(secondaryParameter, out int repeatAmount)) {
1069+
if (secondParameter != String.Empty && secondParameter != null) {
1070+
if (Int32.TryParse(secondParameter, out int repeatAmount)) {
10681071
timesToClick = repeatAmount;
10691072
} else {
10701073
Error("Secondary parameter (how many times to click) is not a valid number");
@@ -1129,6 +1132,11 @@ public void Wait(string parameter) {
11291132
}
11301133
}
11311134

1135+
//Fix for shortcuts; don't show an error
1136+
public void IgnoreMe() {
1137+
successMessage = "Ignoring filename";
1138+
}
1139+
11321140
/* End of actions */
11331141
}
11341142
}

AssistantComputerControl/App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@
8383
<setting name="AutoFileMarginFixer" serializeAs="String">
8484
<value>0</value>
8585
</setting>
86+
<setting name="StartsUsingRegistry" serializeAs="String">
87+
<value>False</value>
88+
</setting>
8689
</AssistantComputerControl.Properties.Settings>
8790
</userSettings>
8891
<runtime>

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.4.2.%2a</ApplicationVersion>
38+
<ApplicationVersion>1.4.4.%2a</ApplicationVersion>
3939
<UseApplicationTrust>false</UseApplicationTrust>
4040
<CreateDesktopShortcut>true</CreateDesktopShortcut>
4141
<PublishWizardCompleted>true</PublishWizardCompleted>
@@ -332,6 +332,7 @@
332332
<None Include="packages.config" />
333333
<None Include="Properties\Settings.settings">
334334
<Generator>SettingsSingleFileGenerator</Generator>
335+
<LastGenOutput>Settings1.Designer.cs</LastGenOutput>
335336
</None>
336337
<None Include="Resources\ACC_icon.ico" />
337338
</ItemGroup>

AssistantComputerControl/CleanupService.cs

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* AssistantComputerControl
33
* Made by Albert MN.
4-
* Updated: v1.4.0, 15-01-2020
4+
* Updated: v1.4.4, 08-05-2021
55
*
66
* Use:
77
* - Cleans action files up after they've been processed
@@ -69,7 +69,7 @@ void ExtraCleanup() {
6969

7070
Process p = new Process();
7171
p.StartInfo.FileName = "powershell.exe";
72-
p.StartInfo.Arguments = $"-WindowStyle Hidden -file \"{ps1File}\" \"{Path.Combine(MainProgram.CheckPath(), "*")}\" \"*.{Properties.Settings.Default.ActionFileExtension}\"";
72+
p.StartInfo.Arguments = $"-WindowStyle Hidden -file \"{ps1File}\" \"{Path.Combine(MainProgram.CheckPath(true), "*")}\" \"*.{Properties.Settings.Default.ActionFileExtension}\"";
7373
p.StartInfo.UseShellExecute = false;
7474
p.StartInfo.CreateNoWindow = true;
7575
p.Start();
@@ -89,29 +89,36 @@ void ExtraCleanup() {
8989
}
9090

9191
private bool EmptyCheck() {
92-
return Directory.GetFiles(MainProgram.CheckPath()).Length > 0;
92+
return Directory.GetFiles(MainProgram.CheckPath(true)).Length > 0;
9393
}
9494

9595
private int AllHiddenCheck() {
9696
int count = 0;
97-
foreach (string file in Directory.GetFiles(MainProgram.CheckPath(), "*." + Properties.Settings.Default.ActionFileExtension)) {
98-
bool hidden = (File.GetAttributes(file) & FileAttributes.Hidden) == FileAttributes.Hidden;
99-
if (!hidden || file.Contains("computerAction")) {
100-
//MainProgram.DoDebug("[CLEANUP] Found file; " + file);
101-
count++;
97+
foreach (string file in Directory.GetFiles(MainProgram.CheckPath(true), "*." + Properties.Settings.Default.ActionFileExtension)) {
98+
if (File.Exists(file)) {
99+
try {
100+
//Shouldn't think it'd be needed, but it is
101+
bool hidden = (File.GetAttributes(file) & FileAttributes.Hidden) == FileAttributes.Hidden;
102+
if (!hidden || file.Contains("computerAction")) {
103+
//MainProgram.DoDebug("[CLEANUP] Found file; " + file);
104+
count++;
105+
}
106+
} catch {
107+
//Probably failed to get attribute
108+
}
102109
}
103110
}
104111
return count;
105112
}
106113

107114
private bool Check() {
108115
if (EmptyCheck()) {
109-
DirectoryInfo di = new DirectoryInfo(MainProgram.CheckPath());
116+
DirectoryInfo di = new DirectoryInfo(MainProgram.CheckPath(true));
110117

111118
int numFiles = 0;
112119

113120
try {
114-
foreach (string file in Directory.GetFiles(MainProgram.CheckPath(), "*." + Properties.Settings.Default.ActionFileExtension)) {
121+
foreach (string file in Directory.GetFiles(MainProgram.CheckPath(true), "*." + Properties.Settings.Default.ActionFileExtension)) {
115122
//if (cleanedFiles.Contains(file)) continue;
116123

117124
bool hidden = (File.GetAttributes(file) & FileAttributes.Hidden) == FileAttributes.Hidden;
@@ -126,7 +133,7 @@ private bool Check() {
126133

127134
//string newFilename = Path.Combine(Path.GetDirectoryName(file), "action_" + DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString() + "_" + Guid.NewGuid() + "." + Properties.Settings.Default.ActionFileExtension);
128135
//string newFilename = Path.Combine(tmpFolder, "action_" + DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString() + "_" + Guid.NewGuid() + "." + Properties.Settings.Default.ActionFileExtension);
129-
//string newFilename = Path.Combine(Path.Combine(MainProgram.CheckPath(), "used_actions"), "action_" + DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString() + "_" + Guid.NewGuid() + "." + Properties.Settings.Default.ActionFileExtension);
136+
//string newFilename = Path.Combine(Path.Combine(MainProgram.CheckPath(true), "used_actions"), "action_" + DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString() + "_" + Guid.NewGuid() + "." + Properties.Settings.Default.ActionFileExtension);
130137
//File.Move(file, newFilename);
131138
//File.Delete(newFilename);
132139
File.Delete(file);

0 commit comments

Comments
 (0)