Skip to content

Commit

Permalink
Fix installation issue & minor improvements (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
neuralpain authored May 25, 2024
2 parents 4a8bd62 + ce5de1b commit 74b21f8
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 55 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog

## v0.22.0
## v0.23.0
- Add manual refresh option to update menu head information
- Fix issue [#43](https://github.com/neuralpain/qbactivator/issues/43) where `qba-22` ignored local available POS installers
- Minor improvements

#### v0.22.0
- Add new Troubleshooting menu
- Add option `Lv3` in troubleshooting to potentially fix "Invalid Product Code" error
- Add 16 more licenses for each version of POS, a total of 64 new licenses; available for client activation
Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Activation script for QuickBooks Point of Sale Software on Windows. — [Downloa
- Windows 10
- Windows 8.1
- Windows 7 SP1 (requires [Windows Management Framework 4.0][wikiwmf4])
- Windows Server 2012-2022
- Windows Server 2012-2022 (ref. [#44][issue_44])

> [!IMPORTANT]
> `qbactivator` **requires** at least PowerShell 4.0 [or later][updatepowershell] to be installed on your Windows machine in order to function as intended. If you are using Windows 10 or above, it is likely that PowerShell 5.1 or a later version is already installed on your machine. You can check your PowerShell version by using the `$PSVersionTable` command in PowerShell if you are unsure.
Expand All @@ -51,7 +51,12 @@ Activation script for QuickBooks Point of Sale Software on Windows. — [Downloa
> [!NOTE]
> ### Latest Release [][release]
>
> **v0.22.0**
> **v0.23.0**
> - Add manual refresh option to update menu head information
> - Fix issue [#43](https://github.com/neuralpain/qbactivator/issues/43) where `qba-22` ignored local available POS installers
> - Minor improvements
>
> *v0.22.0*
> - Add new Troubleshooting menu
> - Add option `Lv3` in troubleshooting to potentially fix "Invalid Product Code" error
> - Add 16 more licenses for each version of POS, a total of 64 new licenses; available for client activation
Expand All @@ -67,10 +72,6 @@ Activation script for QuickBooks Point of Sale Software on Windows. — [Downloa
> - Fix validation bug on local patch files
> - Fix bug preventing launch of QuickBooks POS application after installation
> - Minor bug fixes
>
> *v0.21.1*
> - Fix licensing issues for POS v19 ([#30](https://github.com/neuralpain/qbactivator/issues/30)) and custom licenses ([#31](https://github.com/neuralpain/qbactivator/issues/31))
> - Code refactoring
### Release Breakdown

Expand Down Expand Up @@ -128,9 +129,9 @@ Licensed under [BSD 2-Clause](LICENSE).
[getstarted]: https://github.com/neuralpain/qbactivator/wiki#getting-started
[update]: https://github.com/neuralpain/qbactivator/wiki#downloads--updates
[instructions]: https://github.com/neuralpain/qbactivator/wiki/How-to-Use
[download_cmd]: https://github.com/neuralpain/qbactivator/releases/download/v0.22.0/qbactivator-0.22.0.cmd
[download_min]: https://github.com/neuralpain/qbactivator/releases/download/v0.22.0/qbactivator-0.22.0.min.zip
[download]: https://github.com/neuralpain/qbactivator/releases/download/v0.22.0/qbactivator-0.22.0.zip
[download_cmd]: https://github.com/neuralpain/qbactivator/releases/latest/download/qbactivator-0.23.0.cmd
[download_min]: https://github.com/neuralpain/qbactivator/releases/latest/download/qbactivator-0.23.0.min.zip
[download]: https://github.com/neuralpain/qbactivator/releases/latest/download/qbactivator-0.23.0.zip
[release]: https://github.com/neuralpain/qbactivator/releases/latest
[powershell]: https://github.com/PowerShell/PowerShell/releases/latest
[updatepowershell]: https://github.com/neuralpain/qbactivator/wiki/Updating-PowerShell
Expand All @@ -139,4 +140,5 @@ Licensed under [BSD 2-Clause](LICENSE).
[issue_10]: https://github.com/neuralpain/qbactivator/issues/10#issuecomment-1416758671
[issue_12]: https://github.com/neuralpain/qbactivator/issues/12#issuecomment-1478727716
[issue_27]: https://github.com/neuralpain/qbactivator/issues/27#issuecomment-1913171241
[issue_44]: https://github.com/neuralpain/qbactivator/issues/44
<!-- End Links -->
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.22.0
0.23.0
3 changes: 2 additions & 1 deletion src/Main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ function Invoke-NextProcess {
}
$PROC_LICENSE {
&$LocateQuickBooksInstaller
&$ValidateQuickBooksInstaller
if ($Script:INSTALLER_AVAILABLE) { &$ValidateQuickBooksInstaller }
else { Invoke-NextProcess $PROC_DOWNLOAD } # get an installer
Get-IntuitLicense $Script:INSTALLER_HASH
Install-IntuitLicense
Invoke-NextProcess $PROC_INSTALL
Expand Down
4 changes: 2 additions & 2 deletions src/functions/ObjectsAndVariables.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ $pos11_licenses = @("4152-7820-7508-121", "4710-8115-1842-661", "6666-1981-1862-
$PATCH_HASH = "1A1816C78925E734FCA16974BDBAA4AA"
$LOCAL_PATCH_FILE = ".\EntClient.dll"
$LOCAL_GENUINE_FILE = ".\EntClientGenuine.dll"
$CLIENT_FILE_ON_HOST = "https://raw.githubusercontent.com/neuralpain/qbactivator/v0.22.0/src/bin/ecc/EntClient.dll"
$GENUINE_CLIENT_FILE_ON_HOST = "https://raw.githubusercontent.com/neuralpain/qbactivator/v0.22.0/src/bin/ecc/EntClientGenuine.dll"
$CLIENT_FILE_ON_HOST = "https://raw.githubusercontent.com/neuralpain/qbactivator/main/src/bin/ecc/EntClient.dll"
$GENUINE_CLIENT_FILE_ON_HOST = "https://raw.githubusercontent.com/neuralpain/qbactivator/main/src/bin/ecc/EntClientGenuine.dll"

$CLIENT_MODULE_DATA = "EntitlementDataStore.ecml"
$CLIENT_MODULE_DATA_PATH = "$env:ProgramData\Intuit\Entitlement Client\v8"
Expand Down
42 changes: 30 additions & 12 deletions src/functions/display/DisplayMenu.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ $InvokeGeneralActivation = {
Invoke-NextProcess $PROC_NEXT_STAGE
}

$ExitQbactivator = { Invoke-NextProcess $PROC_EXIT }
$OpenWiki = { Invoke-URLInDefaultBrowser -URL "https://github.com/neuralpain/qbactivator/wiki" }
$OpenLogs = { explorer.exe "C:\Windows\Logs\qbactivator" }

function Write-Menu_Main {
&$InitializeMain
&$VerifyIfQuickBooksIsInstalled
Expand All @@ -14,15 +18,16 @@ function Write-Menu_Main {
Write-Host "3 - POS Client Workstations"
Write-Host "4 - I have my own license :p"
Write-Host "5 - Troubleshooting"
Write-Host "6 - Refresh qbactivator"
Write-Host "0 - Exit"
$query = Read-Host "`n#"

switch ($query) {
0 {
Invoke-NextProcess $PROC_EXIT
break
}
0 { &$ExitQbactivator }
10 { &$InvokeGeneralActivation }
100 { &$ExitQbactivator }
300 { &$OpenWiki; Write-Menu_Main }
500 { &$OpenLogs; Write-Menu_Main }
1 {
$Script:SECOND_STORE = $false
$Script:ADDITIONAL_CLIENTS = $false
Expand All @@ -48,7 +53,12 @@ function Write-Menu_Main {
5 {
Invoke-NextProcess $PROC_TROUBLESHOOT
}
default { Write-Menu_Main }
6 {
&$InitializeMain
&$VerifyIfQuickBooksIsInstalled
Invoke-NextProcess $PROC_RETURN_MAIN
}
default { Invoke-NextProcess $PROC_RETURN_MAIN }
}
}

Expand All @@ -71,10 +81,12 @@ function Write-Menu_SubMenu {
break
}
10 { &$InvokeGeneralActivation }
100 { Invoke-NextProcess $PROC_EXIT }
100 { &$ExitQbactivator }
300 { &$OpenWiki; Write-Menu_SubMenu }
500 { &$OpenLogs; Write-Menu_SubMenu }
1 {
&$CheckQuickBooksIsInstalled_ReturnToMainMenu
Invoke-NextProcess $PROC_DOWNLOAD
Invoke-NextProcess $PROC_LICENSE
break
}
2 {
Expand Down Expand Up @@ -111,7 +123,9 @@ function Write-Menu_VersionSelection {
# allow exit at any point in time
switch ($query) {
10 { &$InvokeGeneralActivation }
100 { Invoke-NextProcess $PROC_EXIT }
100 { &$ExitQbactivator }
300 { &$OpenWiki; Write-Menu_VersionSelection }
500 { &$OpenLogs; Write-Menu_VersionSelection }
}
}

Expand All @@ -130,7 +144,9 @@ function Write-Menu_Troubleshooting {
switch ($query) {
0 { Write-Menu_Main; break }
10 { &$InvokeGeneralActivation }
100 { Invoke-NextProcess $PROC_EXIT }
100 { &$ExitQbactivator }
300 { &$OpenWiki; Write-Menu_Troubleshooting }
500 { &$OpenLogs; Write-Menu_Troubleshooting }
1 {
Stop-QuickBooksProcesses
Repair-GenuineClientModule_LevelOne
Expand Down Expand Up @@ -177,10 +193,12 @@ function Write-Menu_LinkOptions {
switch ($query) {
0 { Write-Menu_Troubleshooting; break }
10 { &$InvokeGeneralActivation }
100 { Invoke-NextProcess $PROC_EXIT }
100 { &$ExitQbactivator }
300 { &$OpenWiki; Write-Menu_LinkOptions }
500 { &$OpenLogs; Write-Menu_LinkOptions }
1 {
Write-Host "Opening qbactivator Wiki..."
Invoke-URLInDefaultBrowser -URL "https://github.com/neuralpain/qbactivator/wiki"
&$OpenWiki
Write-Menu_LinkOptions
break
}
Expand All @@ -190,7 +208,7 @@ function Write-Menu_LinkOptions {
break
}
3 {
explorer.exe "C:\Windows\Logs\qbactivator"
&$OpenLogs
Write-Menu_LinkOptions
break
}
Expand Down
25 changes: 8 additions & 17 deletions src/functions/repair/ClientModuleRepairs.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
function Repair-GenuineClientModule_LevelOne {
# param([Switch]$Lv2AddedGenuineClientModule)
# Step 2: Check if the .bak file exists
<#
.SYNOPSIS
Check if the .bak file exists
#>
if (Test-Path "${CLIENT_MODULE_FULL_PATH}.bak" -PathType Leaf) {
Write-Host "Lv1: Fixing error on client module... "
Remove-Item $CLIENT_MODULE_FULL_PATH -Force >$null 2>&1
Expand All @@ -20,8 +22,11 @@ function Repair-GenuineClientModule_LevelOne {
}

function Repair-GenuineClientModule_LevelTwo_SanityCheck {
<#
.SYNOPSIS
Check if the client file is the genuine one and make any additional repairs. Will only run if this is requested.
#>
param([switch]$SanityCheck)
# Step 3: Check if the client file is the genuine one. Will only run if this is requested.
# if a client module is found on the system then, do a comparison with the PATCH_HASH for genuineity
if ($SanityCheck) { Write-Host "Lv2: Performing a sanity check..." }

Expand Down Expand Up @@ -65,17 +70,3 @@ function Repair-GenuineClientModule_LevelTwo_SanityCheck {
Start-Sleep -Milliseconds $TIME_SLOW
}
}

function Repair-GenuineClientModule {
# Step 1: Check if QuickBooks is installed
switch ($Script:QUICKBOOKS_IS_INSTALLED) {
$true { Repair-GenuineClientModule_LevelOne; break }
$false {
Write-Error_QuickBooksNotInstalled
$Script:RUN_NEXT_PROCEDURE = $null
break
}
}
# Step 2: Repair-GenuineClientModule_LevelOne -> Check if the .bak file exists
# Step 3: Repair-GenuineClientModule_LevelTwo_SanityCheck -> Check if the client file is the genuine one and make any additional repairs
}
23 changes: 11 additions & 12 deletions src/functions/setup/PosActivation.ps1
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
function Start-PosActivation {
Stop-QuickBooksProcesses
Repair-GenuineClientModule # if damaged

# toll gate #1 --------- why?
if ($null -eq $Script:RUN_NEXT_PROCEDURE) { return }

&$VerifyIfQuickBooksIsInstalled
if (-not($Script:QUICKBOOKS_IS_INSTALLED)) {
Write-Error_QuickBooksNotInstalled
$Script:RUN_NEXT_PROCEDURE = $null

switch ($Script:QUICKBOOKS_IS_INSTALLED) {
$true {
Repair-GenuineClientModule_LevelOne
break
}
$false {
Write-Error_QuickBooksNotInstalled
Invoke-NextProcess $PROC_RETURN_MAIN
break
}
}

# toll gate #2
if ($null -eq $Script:RUN_NEXT_PROCEDURE) { return }

# Find-GenuineClientModule # will exit if missing
Install-ClientModule # inject modified client module
Write-Host "Proceeding with activation..."
Start-Sleep -Milliseconds $TIME_SLOW
Expand Down

0 comments on commit 74b21f8

Please sign in to comment.