Skip to content

Commit

Permalink
Version 2.0 (all as one commit :P)
Browse files Browse the repository at this point in the history
  • Loading branch information
HorridModz committed Jul 31, 2024
1 parent 7924580 commit 31908da
Show file tree
Hide file tree
Showing 12 changed files with 651 additions and 218 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
test.cs
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
Expand Down
15 changes: 11 additions & 4 deletions .idea/.idea.FlowLauncher Add2Path Plugin/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions Configure_FlowLauncher_AlwaysRunAsAdmin.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
:: Hacked (skidded?) together with ChatGPT

@echo off
setlocal

:: Define the path to the Flow.Launcher executable
set "exePath=%LocalAppData%\FlowLauncher\Flow.Launcher.exe"

:: Check if the executable exists
if exist "%exePath%" (
echo Flow.Launcher executable found at %exePath%
) else (
echo Flow.Launcher executable not found at %exePath%
set /p "exePath=Please enter the path to the Flow.Launcher executable (the file itself, not the folder): "
)


:: Check if the file at the provided path exists
if not exist "%exePath%" (
echo file not found at this path
pause
goto :end
)
)

:: Display the path to the user
echo Using executable: %exePath%

:: Use PowerShell to set the executable to always run as administrator
powershell -command "Set-ItemProperty -Path 'Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers' -Name '%exePath%' -Value 'RUNASADMIN'"

echo The Flow.Launcher executable has been set to always run as administrator.
pause
:end
26 changes: 26 additions & 0 deletions Extensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

namespace Flow.Launcher.Plugin.Add2Path
{

static class ZipStringExtension
{
public static IEnumerable<List<char>> Zip(this string str1, string str2)
{
/* Zips two strings together, so that they may be iterated over.
* Wrapper for Enumerable.Zip() method; convenient because it converts strings to lists and specifies to return zipped element as an
* IEnumerable containing List<char>'s of the two chars for each index
* Returns an IEnumerable containing Lists of two chars each.
* The function can be called and iterated over like this:
* foreach (List<char> chars in Zip(str1, str2)
{
char char1 = chars[0]; char char2 = chars[1];
}
*/
return str1.ToList().Zip(str2.ToList(), (char1, char2) => new List<char>() { char1, char2 });
}
}
}
66 changes: 34 additions & 32 deletions Flow.Launcher.Plugin.Add2Path.csproj
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<AssemblyName>Flow.Launcher.Plugin.Add2Path</AssemblyName>
<PackageId>Flow.Launcher.Plugin.Add2Path</PackageId>
<Authors>HorridModz</Authors>
<PackageProjectUrl>https://github.com/HorridModz/Flow.Launcher.Plugin.Add2Path</PackageProjectUrl>
<RepositoryUrl>https://github.com/HorridModz/Flow.Launcher.Plugin.Add2Path</RepositoryUrl>
<PackageTags>flow-launcher flow-plugin</PackageTags>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugSymbols>false</DebugSymbols>
<DebugType>None</DebugType>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<AssemblyName>Flow.Launcher.Plugin.Add2Path</AssemblyName>
<PackageId>Flow.Launcher.Plugin.Add2Path</PackageId>
<Authors>HorridModz</Authors>
<PackageProjectUrl>https://github.com/HorridModz/Flow.Launcher.Plugin.Add2Path</PackageProjectUrl>
<RepositoryUrl>https://github.com/HorridModz/Flow.Launcher.Plugin.Add2Path</RepositoryUrl>
<PackageTags>flow-launcher flow-plugin</PackageTags>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
<SignAssembly>False</SignAssembly>
</PropertyGroup>

<ItemGroup>
<Content Include="plugin.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugSymbols>false</DebugSymbols>
<DebugType>None</DebugType>
</PropertyGroup>

<Content Include="icon.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="plugin.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>

<ItemGroup>
<PackageReference Include="Flow.Launcher.Plugin" Version="4.1.0" />
</ItemGroup>
<Content Include="icon.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

</Project>
<ItemGroup>
<PackageReference Include="Flow.Launcher.Plugin" Version="4.1.0" />
</ItemGroup>

</Project>
19 changes: 11 additions & 8 deletions FlowLauncher.Plugin.Add2Path.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.6.33829.357
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Flow.Launcher.Plugin.Add2Path", "Flow.Launcher.Plugin.Add2Path.csproj", "{0D5934A1-77FE-4AEC-82F5-CDD2710B5CC8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Add2Path", "Flow.Launcher.Plugin.Add2Path.csproj", "{0D5934A1-77FE-4AEC-82F5-CDD2710B5CC8}"
EndProject
Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {89387D62-9F6E-4E65-8943-3E6F0CD7C3FE}
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0D5934A1-77FE-4AEC-82F5-CDD2710B5CC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D5934A1-77FE-4AEC-82F5-CDD2710B5CC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D5934A1-77FE-4AEC-82F5-CDD2710B5CC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D5934A1-77FE-4AEC-82F5-CDD2710B5CC8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Any CPU = Release|Any CPU
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {89387D62-9F6E-4E65-8943-3E6F0CD7C3FE}
EndGlobalSection
EndGlobal
Loading

0 comments on commit 31908da

Please sign in to comment.