template 폴더에 압축파일을 두고 그것을 자동 압축 해제하도록 함 , webview2 runtime 을 추가

This commit is contained in:
2025-12-11 22:41:51 +09:00
parent 1fd7c25c8d
commit 6fbfa52a00
11 changed files with 386 additions and 4254 deletions

View File

@@ -293,30 +293,45 @@ Public Class MdiMain
End Sub
Private Sub CheckAndExtractWwwroot()
Try
' wwwroot 폴더 경로 확인
Dim wwwrootPath As String = Path.Combine(Application.StartupPath, "wwwroot")
Dim indexHtmlPath As String = Path.Combine(wwwrootPath, "index.html")
Dim zipPath As String = Path.Combine(wwwrootPath, "wwwroot.zip")
Dim templatePath As String = Path.Combine(Application.StartupPath, "Template")
If System.IO.Directory.Exists(templatePath) = False Then Return
' wwwroot 폴더가 없거나 index.html이 없는 경우
If (Not Directory.Exists(wwwrootPath) OrElse Not File.Exists(indexHtmlPath)) Then
' wwwroot.zip 파일이 존재하는지 확인
If File.Exists(zipPath) Then
' 압축 해제 폼 표시
Dim extractForm As New Frm_WwwrootExtract()
extractForm.ShowDialog()
Dim zipfiles() As String = System.IO.Directory.GetFiles(templatePath, "*.zip")
If zipfiles.Length = 0 Then Return
' 압축 해제가 실패한 경우
If extractForm.DialogResult <> DialogResult.OK Then
MessageBox.Show("매뉴얼 파일 압축 해제에 실패했습니다." & vbCrLf & "일부 기능이 제한될 수 있습니다.",
"경고", MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If
'압축파일 이름으로 폴더를 생성해서 압축 해제한다.
For Each zipfilename As String In zipfiles
Dim nameOnly As String = System.IO.Path.GetFileNameWithoutExtension(zipfilename)
Dim zipcheckfile As String = zipfilename + ".complete"
If System.IO.File.Exists(zipcheckfile) Then Continue For
Dim targetPath As New DirectoryInfo(Path.Combine(Application.StartupPath, nameOnly))
'//폴더가 존재하지 않는경우 생성
If targetPath.Exists = False Then targetPath.Create()
' 압축 해제 폼 표시
Dim extractForm As New Frm_WwwrootExtract(targetPath.FullName, zipfilename)
extractForm.ShowDialog()
' 압축 해제가 실패한 경우
If extractForm.DialogResult <> DialogResult.OK Then
MessageBox.Show("파일 압축 해제에 실패했습니다." & vbCrLf & "일부 기능이 제한될 수 있습니다.",
"경고", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Else
System.IO.File.WriteAllText(zipcheckfile, "complete", System.Text.Encoding.UTF8)
End If
End If
Next
Catch ex As Exception
' 오류가 발생해도 프로그램은 계속 실행
MessageBox.Show("매뉴얼 파일 확인 중 오류가 발생했습니다: " & ex.Message,
MessageBox.Show("매뉴얼 파일 확인 중 오류가 발생했습니다: " & ex.Message,
"경고", MessageBoxButtons.OK, MessageBoxIcon.Warning)
End Try
End Sub