Skip to content

Commit 6d4990a

Browse files
committed
fix install script
1 parent 113a8f9 commit 6d4990a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

access-add-in/Install.vbs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ MsgBox "Before updating the add-in file, the add-in must not be loaded!" & chr(1
1010
Select Case MsgBox("Should the add-in be used as a compiled file (accde)?" + chr(13) & _
1111
"(Add-In is compiled and copied to the Add-In directory.)", 3, MsgBoxTitle)
1212
case 6 ' vbYes
13-
AddInFileInstalled = CreateMde(GetSourceFileFullName, GetDestFileFullName)
13+
tempAccdb = GetDestFileFullName & ".accdb"
14+
FileCopy GetSourceFileFullName, tempAccdb
15+
AddInFileInstalled = CreateMde(tempAccdb, GetDestFileFullName)
1416
If AddInFileInstalled Then
1517
CompletedMsg = "Add-In was compiled and saved in '" + GetAddInLocation + "'."
1618
Else
1719
CompletedMsg = "Error! Compiled file was not created."
1820
End If
21+
DeleteFile tempAccdb
1922
case 7 ' vbNo
2023
AddInFileInstalled = FileCopy(GetSourceFileFullName, GetDestFileFullName)
2124
If AddInFileInstalled Then
@@ -68,8 +71,15 @@ Function FileCopy(SourceFilePath, DestFilePath)
6871
FileCopy = True
6972
End Function
7073

74+
Function DeleteFile(FilePath)
75+
set fso = CreateObject("Scripting.FileSystemObject")
76+
fso.DeleteFile FilePath
77+
DeleteFile = True
78+
End Function
79+
7180
Function CreateMde(SourceFilePath, DestFilePath)
7281
Set AccessApp = CreateObject("Access.Application")
82+
msgbox SourceFilePath & " -> " & DestFilePath
7383
AccessApp.SysCmd 603, (SourceFilePath), (DestFilePath)
7484
CreateMde = True
7585
End Function

0 commit comments

Comments
 (0)