Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions access-add-in/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Version Control Add-in Binaries
# (This should be built from source and not committed to version control)
*.accda
*.accdb
*.zip

# Database lock files
*.laccdb

# Comment out the following line if you wish to include the log files in git.
*.log

# The local VCS index file is paired with the database and should not
# be comitted to version control.
vcs-index.json

# Ignore any dotenv files (used for external database connections)
*.env

155 changes: 155 additions & 0 deletions access-add-in/AccUnitLoader_Install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
$AddInName = "ACLib-AccUnit-Loader"
$AddInFileName = "AccUnitLoader.accda"
$MsgBoxTitle = "Update ACLib-AccUnit-Loader"


function Get-SourceFileFullName {
$ScriptLocation = Get-ScriptLocation
$retVal = '' + $ScriptLocation + $AddInFileName
$retVal
}

function Get-DestFileFullName {
$AddInLocation = Get-AddInLocation
$retVal = $AddInLocation + $AddInFileName
$retVal
}

function Get-ScriptLocation {
$retVal = '' + $PSScriptRoot + "\"
$retVal
}

function Get-AddInLocation {
$env:APPDATA + "\Microsoft\AddIns\"
}

function FileCopy {
Param($SourceFilePath, $DestFilePath)
Copy-Item $SourceFilePath -Destination $DestFilePath
$true
}

function Delete-AddInFiles {

$DestFile = Get-DestFileFullName
$AddInLocation = Get-AddInLocation
$tlbPath = "\lib\AccessCodeLib.AccUnit.tlb"
$Tlbfile = $AddInLocation + $tlbPath

# Remove-Item -Path $DestFile -Force
# Remove-Item -Path $Tlbfile -Force

}

function CopyFileAndRunPrecompileProc {

Param($SourceFilePath, $DestFilePath)

[System.Windows.Forms.MessageBox]::Show($SourceFilePath, "SourceFilePath", 0)


#Copy-Item -Path $SourceFilePath -Destination $DestFilePath

$ret = Run-PrecompileProcedure $DestFilePath
If ($ret -eq $true) {
$true
}
else {
$false
}
}

function CreateMde {
Param($SourceFilePath, $DestFilePath)

Delete-AddInFiles

$FileToCompile = $DestFilePath + ".accdb"
$copied = FileCopy $SourceFilePath $FileToCompile
If ($copied -ne $true) {
return
}

#$AccessApp = New-Object -ComObject Access.Application
$ret = Run-PrecompileProcedure $FileToCompile
If ($ret -ne $true) {
return
}

return

$AccessApp.SysCmd(603, ($FileToCompile), ($DestFilePath))

Remove-Item -Path $FileToCompile -Force

$true

}

function Run-PrecompileProcedure {
Param([string]$AccdbFilePath)

$AccessApp = New-Object -ComObject Access.Application
$AccessApp.Visible = $true

$AccessApp.OpenCurrentDatabase("" + $AccdbFilePath)

$RunMethod = "CheckAccUnitTypeLibFile"
$AccessApp.Run($RunMethod)
$AccessApp.CloseCurrentDatabase

$true

}


####main


$msg = "Before updating the add-in file, the add-in must not be loaded!
For safety, close all Access instances."

[System.Windows.Forms.MessageBox]::Show($msg, $MsgBoxTitle + ": Information", 0)

$msg ="Should the add-in be used as a compiled file (accde)?
(Add-In is compiled and copied to the Add-In directory.)"

$msgRet = [System.Windows.Forms.MessageBox]::Show($msg, $MsgBoxTitle, 3)

$AddInLocation = Get-AddInLocation

switch ( $msgRet )
{
"Yes" {
$AddInFileInstalled = $true # CreateMde(GetSourceFileFullName, GetDestFileFullName)

If ( $AddInFileInstalled -eq $true ) {
$CompletedMsg = "Add-In was compiled and saved in '" + $AddInLocation + "'."
}
Else {
$CompletedMsg = "Error! Compiled file was not created."
}

}

"No" {
#Delete-AddInFiles
$SourceFileFullName = Get-SourceFileFullName
$DestFileFullName = Get-DestFileFullName
$AddInFileInstalled = CopyFileAndRunPrecompileProc $SourceFileFullName $DestFileFullName
If ( $AddInFileInstalled ) {
$CompletedMsg = "Add-In was saved in '" + $AddInLocation + "'."
}
Else {
$CompletedMsg = "Error! File was not copied."
}
}

default {
return
}
}

[System.Windows.Forms.MessageBox]::Show($CompletedMsg, $MsgBoxTitle, 0)

10 changes: 0 additions & 10 deletions access-add-in/New Text Document.txt

This file was deleted.

Binary file removed access-add-in/source/AccUnitLoaderForm.frm
Binary file not shown.
Binary file removed access-add-in/source/AccUnitUserSettings.frm
Binary file not shown.
17 changes: 0 additions & 17 deletions access-add-in/source/GetAccUnitFactory.bas

This file was deleted.

90 changes: 0 additions & 90 deletions access-add-in/source/codelib/base/defGlobal.bas

This file was deleted.

Loading