Skip to content

Commit

Permalink
update 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonako1 committed Feb 13, 2024
1 parent 6c2c694 commit 6e903d4
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 75 deletions.
2 changes: 1 addition & 1 deletion Hermes.csproj → AudioWhisper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<ApplicationIcon>Hermes.ico</ApplicationIcon>
<ApplicationIcon>AudioWhisper.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion Hermes.sln → AudioWhisper.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hermes", "Hermes.csproj", "{45B3B1A7-4514-424C-8C38-8930EDD2968B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AudioWhisper", "AudioWhisper.csproj", "{45B3B1A7-4514-424C-8C38-8930EDD2968B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- ``` run.bat ```

- Installer (requires [nsis](https://nsis.sourceforge.io/Download)):
- ``` zero_build.bat | build_setup_executable.bat (use dotnet publish) ```
- ``` zero_build.bat ```
- ``` build_setup_executable.bat (use dotnet publish) ```

---
20 changes: 10 additions & 10 deletions build_setup_executable.bat
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
@ECHO OFF
SET "op=.\nsis"
SET "outputPath=.\bin\Debug\net7.0\publish"
echo %outputPath%\Hermes.exe %op%
echo %outputPath%\AudioWhisper.exe %op%
COPY /Y .\src\json\save.json %op%
COPY /Y license.txt %op%
COPY /B /Y Hermes.ico %op%
COPY /B /Y %outputPath%\Hermes.exe %op%
COPY /B /Y %outputPath%\Hermes.dll %op%
COPY /Y %outputPath%\Hermes.deps.json %op%
COPY /B /Y %outputPath%\Hermes.dll %op%
COPY /B /Y %outputPath%\Hermes.exe %op%
COPY /B /Y %outputPath%\Hermes.pdb %op%
COPY /Y %outputPath%\Hermes.runtimeconfig.json %op%
COPY /B /Y AudioWhisper.ico %op%
COPY /B /Y %outputPath%\AudioWhisper.exe %op%
COPY /B /Y %outputPath%\AudioWhisper.dll %op%
COPY /Y %outputPath%\AudioWhisper.deps.json %op%
COPY /B /Y %outputPath%\AudioWhisper.dll %op%
COPY /B /Y %outputPath%\AudioWhisper.exe %op%
COPY /B /Y %outputPath%\AudioWhisper.pdb %op%
COPY /Y %outputPath%\AudioWhisper.runtimeconfig.json %op%
COPY /B /Y %outputPath%\NAudio.Asio.dll %op%
COPY /B /Y %outputPath%\NAudio.Core.dll %op%
COPY /B /Y %outputPath%\NAudio.dll %op%
Expand All @@ -20,4 +20,4 @@ COPY /B /Y %outputPath%\NAudio.Wasapi.dll %op%
COPY /B /Y %outputPath%\NAudio.WinMM.dll %op%
makensis.exe %op%\script.nsi
IF not EXIST ".\build\" MKDIR .\build\
COPY .\nsis\Hermes-Setup.exe .\build\
COPY .\nsis\AudioWhisper-Setup.exe .\build\
114 changes: 57 additions & 57 deletions nsis/script.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ unicode True
!define HWND_BROADCAST 0xFFFF
!define WM_SETTINGCHANGE 0x001A

Outfile "Hermes-Setup.exe"
Outfile "AudioWhisper-Setup.exe"
RequestExecutionLevel admin

BrandingText /TRIMCENTER "Hermes 1.0.0 Setup"
Name "Hermes 1.0.0 Setup"
BrandingText /TRIMCENTER "AudioWhisper 1.0.0 Setup"
Name "AudioWhisper 1.0.0 Setup"
ManifestSupportedOS Win10
DetailsButtonText "Show progress"

Expand All @@ -35,83 +35,83 @@ PageEx components
PageExEnd

SectionGroup "!Main Program" RO
Section !Hermes.exe sec1_id
Section !AudioWhisper.exe sec1_id
DetailPrint "These files go to your TEMP folder. These will be deleted after setup."
SectionInstType ${IT_FULL} ${IT_MIN} RO
SectionIn 1 ${sec1_id}
SetOutPath "$TEMP\temp_hermes_mic_playback"
File "Hermes.exe"
SetOutPath "$TEMP\temp_AudioWhisper_mic_playback"
File "AudioWhisper.exe"
SectionEnd
Section !license.txt sec7_id
SectionInstType ${IT_FULL} ${IT_MIN} RO
SectionIn 1 ${sec1_id}
File "license.txt"
SectionEnd
Section !Hermes.dll sec2_id
Section !AudioWhisper.dll sec2_id
SectionInstType ${IT_FULL} ${IT_MIN} RO
SectionIn 1 ${sec1_id}
SetOutPath "$TEMP\temp_hermes_mic_playback"
File "Hermes.dll"
SetOutPath "$TEMP\temp_AudioWhisper_mic_playback"
File "AudioWhisper.dll"
SectionEnd

Section !Hermes.deps.json sec10_id
Section !AudioWhisper.deps.json sec10_id
SectionInstType ${IT_FULL} ${IT_MIN} RO
SectionIn 1 ${sec1_id}
SetOutPath "$TEMP\temp_hermes_mic_playback"
File "Hermes.deps.json"
SetOutPath "$TEMP\temp_AudioWhisper_mic_playback"
File "AudioWhisper.deps.json"
SectionEnd
Section !Hermes.runtimeconfig.json sec11_id
Section !AudioWhisper.runtimeconfig.json sec11_id
SectionInstType ${IT_FULL} ${IT_MIN} RO
SectionIn 1 ${sec1_id}
SetOutPath "$TEMP\temp_hermes_mic_playback"
File "Hermes.runtimeconfig.json"
SetOutPath "$TEMP\temp_AudioWhisper_mic_playback"
File "AudioWhisper.runtimeconfig.json"
SectionEnd
Section !NAudio.Asio.dll sec12_id
SectionInstType ${IT_FULL} ${IT_MIN} RO
SectionIn 1 ${sec1_id}
SetOutPath "$TEMP\temp_hermes_mic_playback"
SetOutPath "$TEMP\temp_AudioWhisper_mic_playback"
File "NAudio.Asio.dll"
SectionEnd
Section !NAudio.Core.dll sec13_id
SectionInstType ${IT_FULL} ${IT_MIN} RO
SectionIn 1 ${sec1_id}
SetOutPath "$TEMP\temp_hermes_mic_playback"
SetOutPath "$TEMP\temp_AudioWhisper_mic_playback"
File "NAudio.Core.dll"
SectionEnd
Section !NAudio.dll sec14_id
SectionInstType ${IT_FULL} ${IT_MIN} RO
SectionIn 1 ${sec1_id}
SetOutPath "$TEMP\temp_hermes_mic_playback"
SetOutPath "$TEMP\temp_AudioWhisper_mic_playback"
File "NAudio.dll"
SectionEnd
Section !NAudio.Midi.dll sec15_id
SectionInstType ${IT_FULL} ${IT_MIN} RO
SectionIn 1 ${sec1_id}
SetOutPath "$TEMP\temp_hermes_mic_playback"
SetOutPath "$TEMP\temp_AudioWhisper_mic_playback"
File "NAudio.Midi.dll"
SectionEnd
Section !NAudio.Wasapi.dll sec16_id
SectionInstType ${IT_FULL} ${IT_MIN} RO
SectionIn 1 ${sec1_id}
SetOutPath "$TEMP\temp_hermes_mic_playback"
SetOutPath "$TEMP\temp_AudioWhisper_mic_playback"
File "NAudio.Wasapi.dll"
SectionEnd
Section !NAudio.WinMM.dll sec17_id
SectionInstType ${IT_FULL} ${IT_MIN} RO
SectionIn 1 ${sec1_id}
SetOutPath "$TEMP\temp_hermes_mic_playback"
SetOutPath "$TEMP\temp_AudioWhisper_mic_playback"
File "NAudio.WinMM.dll"
SectionEnd
Section !Hermes.ico sec18_id
Section !AudioWhisper.ico sec18_id
SectionInstType ${IT_FULL} ${IT_MIN} RO
SectionIn 1 ${sec1_id}
SetOutPath "$TEMP\temp_hermes_mic_playback"
File "Hermes.ico"
SetOutPath "$TEMP\temp_AudioWhisper_mic_playback"
File "AudioWhisper.ico"
SectionEnd
Section !save.json sec19_id
SectionInstType ${IT_FULL} ${IT_MIN} RO
SectionIn 1 ${sec1_id}
SetOutPath "$TEMP\temp_hermes_mic_playback"
SetOutPath "$TEMP\temp_AudioWhisper_mic_playback"
File "save.json"
SectionEnd
SectionGroupEnd
Expand All @@ -127,7 +127,7 @@ PageExEnd

Function .onVerifyInstDir
Var /GLOBAL ext
StrCpy $ext "Hermes"
StrCpy $ext "AudioWhisper"
StrCpy $INSTALL_DIR "$INSTALL_DIR$ext"
; Checks if folder already exists
Call CheckFolder
Expand Down Expand Up @@ -156,33 +156,33 @@ PageExEnd
; Set the default installation directory
Function .onInit
InitPluginsDir
StrCpy $INSTALL_DIR $APPDATA\Hermes
StrCpy $INSTALL_DIR $APPDATA\AudioWhisper
FunctionEnd

############################## START ##############################
Section
; Delete the $TEMP folder stuff before extracting more files
; and taking up more space from the disk
Delete "$TEMP\temp_hermes_mic_playback\Hermes.exe"
Delete "$TEMP\temp_hermes_mic_playback\Hermes.dll"
Delete "$TEMP\temp_hermes_mic_playback\license.txt"
Delete "$TEMP\temp_hermes_mic_playback\Uninstall.exe"
Delete "$TEMP\temp_hermes_mic_playback\Setup.ps1"
Delete "$TEMP\temp_hermes_mic_playback\Uninstall.ps1"
Delete "$TEMP\temp_hermes_mic_playback\Hermes.deps.json"
Delete "$TEMP\temp_hermes_mic_playback\Hermes.runtimeconfig.json"
Delete "$TEMP\temp_hermes_mic_playback\NAudio.Asio.dll"
Delete "$TEMP\temp_hermes_mic_playback\NAudio.Core.dll"
Delete "$TEMP\temp_hermes_mic_playback\NAudio.dll"
Delete "$TEMP\temp_hermes_mic_playback\NAudio.Midi.dll"
Delete "$TEMP\temp_hermes_mic_playback\NAudio.Wasapi.dll"
Delete "$TEMP\temp_hermes_mic_playback\NAudio.WinMM.dll"
Delete "$TEMP\temp_hermes_mic_playback\Hermes.ico"
Delete "$TEMP\temp_AudioWhisper_mic_playback\AudioWhisper.exe"
Delete "$TEMP\temp_AudioWhisper_mic_playback\AudioWhisper.dll"
Delete "$TEMP\temp_AudioWhisper_mic_playback\license.txt"
Delete "$TEMP\temp_AudioWhisper_mic_playback\Uninstall.exe"
Delete "$TEMP\temp_AudioWhisper_mic_playback\Setup.ps1"
Delete "$TEMP\temp_AudioWhisper_mic_playback\Uninstall.ps1"
Delete "$TEMP\temp_AudioWhisper_mic_playback\AudioWhisper.deps.json"
Delete "$TEMP\temp_AudioWhisper_mic_playback\AudioWhisper.runtimeconfig.json"
Delete "$TEMP\temp_AudioWhisper_mic_playback\NAudio.Asio.dll"
Delete "$TEMP\temp_AudioWhisper_mic_playback\NAudio.Core.dll"
Delete "$TEMP\temp_AudioWhisper_mic_playback\NAudio.dll"
Delete "$TEMP\temp_AudioWhisper_mic_playback\NAudio.Midi.dll"
Delete "$TEMP\temp_AudioWhisper_mic_playback\NAudio.Wasapi.dll"
Delete "$TEMP\temp_AudioWhisper_mic_playback\NAudio.WinMM.dll"
Delete "$TEMP\temp_AudioWhisper_mic_playback\AudioWhisper.ico"

; The folder will be deleted in the Uninstall section
RMDir /r $TEMP\temp_hermes_mic_playback
RMDir /r $TEMP\temp_AudioWhisper_mic_playback

DetailPrint 'Files from "$TEMP\temp_hermes_mic_playback" deleted. beginning setup.'
DetailPrint 'Files from "$TEMP\temp_AudioWhisper_mic_playback" deleted. beginning setup.'

; After deletion begin with setup

Expand Down Expand Up @@ -258,21 +258,21 @@ ${EndIf}

########## MAIN PROGRAM ##########
${If} ${SectionIsSelected} ${sec1_id}
File "Hermes.exe"
File "AudioWhisper.exe"
${EndIf}
${If} ${SectionIsSelected} ${sec2_id}
File "Hermes.dll"
File "AudioWhisper.dll"
${EndIf}

${If} ${SectionIsSelected} ${sec7_id}
File "license.txt"
${EndIf}

${If} ${SectionIsSelected} ${sec10_id}
File "Hermes.deps.json"
File "AudioWhisper.deps.json"
${EndIf}
${If} ${SectionIsSelected} ${sec11_id}
File "Hermes.runtimeconfig.json"
File "AudioWhisper.runtimeconfig.json"
${EndIf}
${If} ${SectionIsSelected} ${sec12_id}
File "NAudio.Asio.dll"
Expand All @@ -293,14 +293,14 @@ ${If} ${SectionIsSelected} ${sec17_id}
File "NAudio.WinMM.dll"
${EndIf}
${If} ${SectionIsSelected} ${sec18_id}
File "Hermes.ico"
File "AudioWhisper.ico"
${EndIf}
${If} ${SectionIsSelected} ${sec19_id}
File "save.json"
${EndIf}

# Create shortcut on DESKTOP
CreateShortcut "$DESKTOP\Hermes.lnk" "$INSTALL_DIR\Hermes.exe" "" "$INSTALL_DIR\Hermes.ico"
CreateShortcut "$DESKTOP\AudioWhisper.lnk" "$INSTALL_DIR\AudioWhisper.exe" "" "$INSTALL_DIR\AudioWhisper.ico"

; Create an uninstaller in the same directory as the installer
WriteUninstaller "$INSTALL_DIR\Uninstall.exe"
Expand Down Expand Up @@ -330,28 +330,28 @@ nsExec::ExecToLog 'Powershell.exe -ExecutionPolicy Bypass -File "$INSTDIR\Uninst
########################### DELETE FILES ###########################
; Remove installed files during uninstallation

Delete "$INSTDIR\Hermes.exe"
Delete "$INSTDIR\AudioWhisper.exe"
Delete "$INSTDIR\save.json"
Delete "$INSTDIR\Hermes.dll"
Delete "$INSTDIR\AudioWhisper.dll"
Delete "$INSTDIR\Uninstall.exe"
Delete "$INSTDIR\license.txt"
Delete "$INSTDIR\Uninstall.ps1"
Delete "$INSTDIR\Setup.ps1"
Delete "$INSTDIR\Hermes.deps.json"
Delete "$INSTDIR\Hermes.runtimeconfig.json"
Delete "$INSTDIR\AudioWhisper.deps.json"
Delete "$INSTDIR\AudioWhisper.runtimeconfig.json"
Delete "$INSTDIR\NAudio.Asio.dll"
Delete "$INSTDIR\NAudio.Core.dll"
Delete "$INSTDIR\NAudio.dll"
Delete "$INSTDIR\NAudio.Midi.dll"
Delete "$INSTDIR\NAudio.Wasapi.dll"
Delete "$INSTDIR\NAudio.WinMM.dll"
Delete "$INSTDIR\Hermes.ico"
Delete "$INSTDIR\AudioWhisper.ico"
Delete "$INSTDIR\save.json"
Delete "$DESKTOP\Hermes.lnk"
Delete "$DESKTOP\AudioWhisper.lnk"

; Remove the installation directory and TEMP directory if it still exists
RMDir /r $INSTDIR
RMDir /r $TEMP\temp_hermes_mic_playback
RMDir /r $TEMP\temp_AudioWhisper_mic_playback

; Lastly refresh icons and env
;Call unRefresh
Expand Down
2 changes: 1 addition & 1 deletion run.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dotnet build
COPY /Y .\src\json\save.json .\
.\bin\Debug\net7.0\Hermes.exe
.\bin\Debug\net7.0\AudioWhisper.exe
6 changes: 3 additions & 3 deletions src/audio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System;

class Program {
public static string appdata_location = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Temp\\temp_hermes_mic_playback\\";
public static string appdata_location = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Temp\\temp_AudioWhisper_mic_playback\\";
private static File_reader? json_file_reader = new();
private JsonObject settings = json_file_reader?.data;
static void Main(string[] args) {
Expand Down Expand Up @@ -119,8 +119,8 @@ private void RecorderOnDataAvailable(object sender, WaveInEventArgs waveInEventA
}
}
private void Console_writing(string what){
Console.Clear();
Console.WriteLine("Currently in:");
Console.Clear();
Console.WriteLine("AudioWhisper | Currently in:");
Console.WriteLine("Main | Main");
switch(what){
case "main":
Expand Down
6 changes: 5 additions & 1 deletion src/read_saves.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ class File_reader{
public File_reader(){
Read_file();
}
/*
Show mute on/off @ Main | Main
On background play (oikee alakulma)
*/
public void Cli(){
bool run_settings = true;
Read_file();
Expand Down Expand Up @@ -142,7 +146,7 @@ private Tuple<int, ReturnObject> Handle_setting(System.ConsoleKey setting_number

private void Console_writing(string what){
Console.Clear();
Console.WriteLine("Currently in:");
Console.WriteLine("Hermes | Currently in:");
switch(what){
case "editing":
Console.WriteLine("Settings | Editing");
Expand Down

0 comments on commit 6e903d4

Please sign in to comment.