From 5b000317d55df1b4a8d4affb724927940bd79646 Mon Sep 17 00:00:00 2001 From: Drago Wulf <14941442+Drago-Wulf@users.noreply.github.com> Date: Sat, 1 Mar 2025 19:16:29 -0500 Subject: [PATCH 1/4] Created a rudimentary Powershell GUI Script to help users set and clear env variables needed for the program to work. --- setup.ps1 | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 setup.ps1 diff --git a/setup.ps1 b/setup.ps1 new file mode 100644 index 0000000..0c1035f --- /dev/null +++ b/setup.ps1 @@ -0,0 +1,82 @@ +Add-Type -AssemblyName System.Windows.Forms +Add-Type -AssemblyName System.Drawing + +$GreetingLabel = New-Object Windows.Forms.Label +$GreetingLabel.Text = "Babagaboosh Env Var Setup" +$GreetingLabel.Font = New-Object Drawing.Font("Arial", 24, [Drawing.FontStyle]::Bold) +$GreetingLabel.AutoSize = $true +$GreetingLabel.Location = New-Object Drawing.Point(10,10) +$GreetingLabel.ForeColor = [System.Drawing.Color]::Black + +$AzureApiOutputBox = New-Object System.Windows.Forms.textbox +$AzureApiOutputBox.Text = "AZURE_TTS_KEY" +$AzureApiOutputBox.Multiline = $False +$AzureApiOutputBox.Size = New-Object System.Drawing.Size(200,200) +$AzureApiOutputBox.Location = New-Object Drawing.Point(20,60) + +$AzureRegionOutputBox = New-Object System.Windows.Forms.textbox +$AzureRegionOutputBox.Text = "AZURE_REGION" +$AzureRegionOutputBox.Multiline = $False +$AzureRegionOutputBox.Size = New-Object System.Drawing.Size(200,200) +$AzureRegionOutputBox.Location = New-Object Drawing.Point(20,100) + +$ElevenLabsOutputBox = New-Object System.Windows.Forms.textbox +$ElevenLabsOutputBox.Text = "ELEVENLABS_API_KEY" +$ElevenLabsOutputBox.Multiline = $False +$ElevenLabsOutputBox.Size = New-Object System.Drawing.Size(200,200) +$ElevenLabsOutputBox.Location = New-Object Drawing.Point(20,140) + +$OpenAiOutputBox = New-Object System.Windows.Forms.textbox +$OpenAiOutputBox.Text = "OPENAI_API_KEY" +$OpenAiOutputBox.Multiline = $False +$OpenAiOutputBox.Size = New-Object System.Drawing.Size(200,200) +$OpenAiOutputBox.Location = New-Object Drawing.Point(20,180) + +$CreateButton = New-Object System.Windows.Forms.Button +$CreateButton.Location = New-Object System.Drawing.Size (200,220) +$CreateButton.Size = New-Object System.Drawing.Size(160,30) +$CreateButton.Font=New-Object System.Drawing.Font("Lucida Console",18,[System.Drawing.FontStyle]::Regular) +$CreateButton.BackColor = "LightGray" +$CreateButton.Text = "Submit" +$CreateButton.Add_Click({ + $AzureApiKey = $AzureApiOutputBox.Text + $AzureRegion = $AzureRegionOutputBox.Text + $OpenAiApiKey = $OpenAiOutputBox.Text + $ElevenLabsApiKey = $ElevenLabsOutputBox.Text + + [Environment]::SetEnvironmentVariable("AZURE_TTS_KEY", $AzureApiKey, [System.EnvironmentVariableTarget]::User) + [Environment]::SetEnvironmentVariable("AZURE_REGION", $AzureRegion, [System.EnvironmentVariableTarget]::User) + [Environment]::SetEnvironmentVariable("ELEVENLABS_API_KEY", $ElevenLabsApiKey, [System.EnvironmentVariableTarget]::User) + [Environment]::SetEnvironmentVariable("OPENAI_API_KEY", $OpenAiApiKey, [System.EnvironmentVariableTarget]::User) + +}) + +$ClearButton = New-Object System.Windows.Forms.Button +$ClearButton.Location = New-Object System.Drawing.Size (200,260) +$ClearButton.Size = New-Object System.Drawing.Size(160,30) +$ClearButton.Font=New-Object System.Drawing.Font("Lucida Console",18,[System.Drawing.FontStyle]::Regular) +$ClearButton.BackColor = "LightGray" +$ClearButton.Text = "Clear" +$ClearButton.Add_Click({ + [Environment]::SetEnvironmentVariable("AZURE_TTS_KEY", [NullString]::Value , [System.EnvironmentVariableTarget]::User) + [Environment]::SetEnvironmentVariable("AZURE_REGION", [NullString]::Value , [System.EnvironmentVariableTarget]::User) + [Environment]::SetEnvironmentVariable("ELEVENLABS_API_KEY", [NullString]::Value , [System.EnvironmentVariableTarget]::User) + [Environment]::SetEnvironmentVariable("OPENAI_API_KEY", [NullString]::Value, [System.EnvironmentVariableTarget]::User) +}) + +$Form = New-Object Windows.Forms.Form +$Form.Text = "Babagaboosh Setup Powershell Script" +$Form.Width = 500 +$Form.Height = 350 +$Form.BackColor = "Gray" + +$Form.Controls.Add($GreetingLabel) +$Form.Controls.add($AzureApiOutputBox) +$Form.Controls.add($AzureRegionOutputBox) +$Form.Controls.add($ElevenLabsOutputBox) +$Form.Controls.add($OpenAiOutputBox) +$Form.Controls.add($CreateButton) +$Form.Controls.add($ClearButton) + +$Form.Add_Shown({$Form.Activate()}) +$Form.ShowDialog() \ No newline at end of file From 4b7a2d72573271a0ef42fd7b85da3ed3eb3e85e7 Mon Sep 17 00:00:00 2001 From: Drago Wulf <14941442+Drago-Wulf@users.noreply.github.com> Date: Sat, 1 Mar 2025 19:17:03 -0500 Subject: [PATCH 2/4] Created a rudimentary Powershell GUI Script to help users set and clear env variables needed for the program to work. --- setup.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setup.ps1 b/setup.ps1 index 0c1035f..27f4f3a 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -14,6 +14,8 @@ $AzureApiOutputBox.Multiline = $False $AzureApiOutputBox.Size = New-Object System.Drawing.Size(200,200) $AzureApiOutputBox.Location = New-Object Drawing.Point(20,60) +$wshell = New-Object -ComObject Wscript.Shell + $AzureRegionOutputBox = New-Object System.Windows.Forms.textbox $AzureRegionOutputBox.Text = "AZURE_REGION" $AzureRegionOutputBox.Multiline = $False @@ -48,6 +50,9 @@ $CreateButton.Add_Click({ [Environment]::SetEnvironmentVariable("AZURE_REGION", $AzureRegion, [System.EnvironmentVariableTarget]::User) [Environment]::SetEnvironmentVariable("ELEVENLABS_API_KEY", $ElevenLabsApiKey, [System.EnvironmentVariableTarget]::User) [Environment]::SetEnvironmentVariable("OPENAI_API_KEY", $OpenAiApiKey, [System.EnvironmentVariableTarget]::User) + + $wshell.Popup("Variables Set",0,"Done",0x1) + }) @@ -62,6 +67,8 @@ $ClearButton.Add_Click({ [Environment]::SetEnvironmentVariable("AZURE_REGION", [NullString]::Value , [System.EnvironmentVariableTarget]::User) [Environment]::SetEnvironmentVariable("ELEVENLABS_API_KEY", [NullString]::Value , [System.EnvironmentVariableTarget]::User) [Environment]::SetEnvironmentVariable("OPENAI_API_KEY", [NullString]::Value, [System.EnvironmentVariableTarget]::User) + + $wshell.Popup("Variables Cleared",0,"Done",0x1) }) $Form = New-Object Windows.Forms.Form From 431b4b64a324e3d2b706f65c94fbe5e7c1aa69ba Mon Sep 17 00:00:00 2001 From: Drago Wulf <14941442+Drago-Wulf@users.noreply.github.com> Date: Sat, 1 Mar 2025 19:18:36 -0500 Subject: [PATCH 3/4] Adjusted name of the powershell script to indicate it only sets up relevant env vars. --- setup.ps1 => env_var_setup.ps1 | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename setup.ps1 => env_var_setup.ps1 (100%) diff --git a/setup.ps1 b/env_var_setup.ps1 similarity index 100% rename from setup.ps1 rename to env_var_setup.ps1 From 192f0f135accc66cbbc8454bd150b914f8075c2a Mon Sep 17 00:00:00 2001 From: Drago Wulf <14941442+Drago-Wulf@users.noreply.github.com> Date: Sat, 1 Mar 2025 19:59:05 -0500 Subject: [PATCH 4/4] added helper batch program for Powershell as Powershell cannot self-execute --- env_var_setup.bat | 1 + 1 file changed, 1 insertion(+) create mode 100644 env_var_setup.bat diff --git a/env_var_setup.bat b/env_var_setup.bat new file mode 100644 index 0000000..6d0ec2a --- /dev/null +++ b/env_var_setup.bat @@ -0,0 +1 @@ +powershell.exe .\env_var_setup.ps1 \ No newline at end of file