diff --git a/AboutBoxWindow/AboutBoxView.xaml.vb b/AboutBoxWindow/AboutBoxView.xaml.vb
index 6488d62..8cb1494 100644
--- a/AboutBoxWindow/AboutBoxView.xaml.vb
+++ b/AboutBoxWindow/AboutBoxView.xaml.vb
@@ -4,10 +4,7 @@ Public Class AboutBoxWndV
Private Sub AboutBoxWD_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
DescriptionLbl.Text = My.Application.Info.Description.ToString()
- VersionLbl.Text = "Version : " & My.Application.Info.Version.Major.ToString() &
- "." & My.Application.Info.Version.Minor.ToString() &
- (ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
- My.Application.Info.Version.Revision.ToString()
+ VersionLbl.Text = "Version : " & GetProgramVersion()
CopyrightLbl.Text = My.Application.Info.Copyright.ToString()
Dim sInfo As String = String.Empty
Dim sKey As String = String.Empty
diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb
index 45e88bb..b047000 100644
--- a/OptionsWindow/OptionModule.vb
+++ b/OptionsWindow/OptionModule.vb
@@ -59,6 +59,13 @@ Friend Module OptionModule
' Variabile che indica se usare lo script per calcolare automaticamente la disposizione quando si passa in lavorazione
Friend m_bUseDispositionScript As Boolean
+ ' Variabili per gli Extra
+ Friend m_bSpecialOn As Boolean
+ Friend m_bBeamOn As Boolean
+ Friend m_bWallOn As Boolean
+ Friend m_bDoorsOn As Boolean
+ Friend m_bGunstockOn As Boolean
+
' inizializzazione lettura variabili ad inizio programma
Friend Sub InitOptionModule()
' Leggo elenco lingue disponibili da file ini
@@ -95,9 +102,9 @@ Friend Module OptionModule
GetPrivateProfileColor(S_GRID, K_MINLNCOLOR, GridColor)
m_GridColor = GridColor
' Inizializzo flag linee ingrossate
- m_bThickLine = GetPrivateProfileInt(S_SCENE, K_LINEWIDTH, 1) <> 1
+ m_bThickLine = ( GetPrivateProfileInt(S_SCENE, K_LINEWIDTH, 1) <> 1)
' Inizializzo flag visualizzazione smussata delle superfici
- m_bSmoothTriMesh = GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0
+ m_bSmoothTriMesh = ( GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
' Inizio colore di default in disegno
Dim DefColor As New Color3d(0, 0, 0)
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
@@ -136,9 +143,15 @@ Friend Module OptionModule
m_SelGeomSurfFinishing = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt))
m_SelGeomWaterJetting = SceneSelModeOpt.PARTCURVES
' Inizializzo variabile che indica posizione nuova operazione di lavorazione
- m_bNewMachiningIsLastOne = If(GetPrivateProfileInt(S_OPTIONS, K_NEWMACHININGISLASTONE, 0) <> 0, True, False)
+ m_bNewMachiningIsLastOne = (GetPrivateProfileInt(S_OPTIONS, K_NEWMACHININGISLASTONE, 0) <> 0)
' Inizializzo variabile che indica se usare script di disposizione
- m_bUseDispositionScript = If(GetPrivateProfileInt(S_OPTIONS, K_USEDISPOSITIONSCRIPT, 0) <> 0, True, False)
+ m_bUseDispositionScript = (GetPrivateProfileInt(S_OPTIONS, K_USEDISPOSITIONSCRIPT, 0) <> 0)
+ ' Inizializzo variabili per Extra
+ m_bSpecialOn = (GetPrivateProfileInt(S_SPECIAL, K_SPECIALENABLE, 0) <> 0)
+ m_bBeamOn = (GetPrivateProfileInt(S_BEAM, K_BEAMENABLE, 0) <> 0)
+ m_bWallOn = (GetPrivateProfileInt(S_WALL, K_WALLENABLE, 0) <> 0)
+ m_bDoorsOn = (GetPrivateProfileInt(S_DOORS, K_DDFENABLE, 0) <> 0)
+ m_bGunstockOn = (GetPrivateProfileInt(S_GUNSTOCK, K_GUNSTOCKENABLE, 0) <> 0)
End Sub
End Module
diff --git a/OptionsWindow/OptionWindowV.xaml b/OptionsWindow/OptionWindowV.xaml
index 9f2afdd..ebd54a0 100644
--- a/OptionsWindow/OptionWindowV.xaml
+++ b/OptionsWindow/OptionWindowV.xaml
@@ -300,6 +300,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OptionsWindow/OptionWindowVM.vb b/OptionsWindow/OptionWindowVM.vb
index ab05011..1c20ce7 100644
--- a/OptionsWindow/OptionWindowVM.vb
+++ b/OptionsWindow/OptionWindowVM.vb
@@ -528,6 +528,87 @@ Public Class OptionWindowVM
End Set
End Property
+ Public Property SpecialOn As Boolean
+ Get
+ Return OptionModule.m_bSpecialOn
+ End Get
+ Set(value As Boolean)
+ OptionModule.m_bSpecialOn = value
+ WritePrivateProfileString(S_SPECIAL, K_SPECIALENABLE, If( value, "1", "0"))
+ End Set
+ End Property
+
+ Public ReadOnly Property BeamEnabled As Boolean
+ Get
+ Return (IniFile.m_nKeyOptions And KEY_OPT.BEAM) <> 0
+ End Get
+ End Property
+ Public ReadOnly Property BeamActive As Boolean
+ Get
+ Return IniFile.IsActiveBeam()
+ End Get
+ End Property
+ Public Property BeamOn As Boolean
+ Get
+ Return BeamEnabled AndAlso OptionModule.m_bBeamOn
+ End Get
+ Set(value As Boolean)
+ OptionModule.m_bBeamOn = value
+ WritePrivateProfileString(S_BEAM, K_BEAMENABLE, If( value, "1", "0"))
+ End Set
+ End Property
+
+ Public ReadOnly Property WallEnabled As Boolean
+ Get
+ Return (IniFile.m_nKeyOptions And KEY_OPT.WALL) <> 0
+ End Get
+ End Property
+ Public ReadOnly Property WallActive As Boolean
+ Get
+ Return IniFile.IsActiveWall()
+ End Get
+ End Property
+ Public Property WallOn As Boolean
+ Get
+ Return WallEnabled AndAlso OptionModule.m_bWallOn
+ End Get
+ Set(value As Boolean)
+ OptionModule.m_bWallOn = value
+ WritePrivateProfileString(S_WALL, K_WALLENABLE, If( value, "1", "0"))
+ End Set
+ End Property
+
+ Public ReadOnly Property DoorsEnabled As Boolean
+ Get
+ Return (IniFile.m_nKeyOptions And KEY_OPT.DOORS) <> 0
+ End Get
+ End Property
+ Public Property DoorsOn As Boolean
+ Get
+ Return DoorsEnabled AndAlso OptionModule.m_bDoorsOn
+ End Get
+ Set(value As Boolean)
+ OptionModule.m_bDoorsOn = value
+ WritePrivateProfileString(S_DOORS, K_DDFENABLE, If( value, "1", "0"))
+ End Set
+ End Property
+
+ Public ReadOnly Property GunstockEnabled As Boolean
+ Get
+ Return (IniFile.m_nKeyOptions And KEY_OPT.GUNSTOCK) <> 0
+ End Get
+ End Property
+ Public Property GunstockOn As Boolean
+ Get
+ Return OptionModule.m_bGunstockOn
+ End Get
+ Set(value As Boolean)
+ OptionModule.m_bGunstockOn = value
+ WritePrivateProfileString(S_GUNSTOCK, K_GUNSTOCKENABLE, If( value, "1", "0"))
+ End Set
+ End Property
+
+
' Definizione comandi
Private m_cmdCloseOptions As ICommand
Private m_cmdTopSceneBackground As ICommand
@@ -537,6 +618,8 @@ Public Class OptionWindowVM
Private m_cmdDefMaterialColor As ICommand
Private m_cmdAddMachineCmd As ICommand
Private m_cmdExportMachineCmd As ICommand
+ Private m_cmdUpdateBeamCmd As ICommand
+ Private m_cmdUpdateWallCmd As ICommand
#Region "Messages"
@@ -608,6 +691,46 @@ Public Class OptionWindowVM
Return EgtMsg(MSG_OPTIONPAGE + 12)
End Get
End Property
+ Public ReadOnly Property DimensionMsg As String
+ Get
+ Return EgtMsg(MSG_OPTIONPAGE + 44) ' Quotatura
+ End Get
+ End Property
+ Public ReadOnly Property ExtLineLenMsg As String
+ Get
+ Return EgtMsg(MSG_OPTIONPAGE + 37) ' Estensione linea
+ End Get
+ End Property
+ Public ReadOnly Property ArrowLenMsg As String
+ Get
+ Return EgtMsg(MSG_OPTIONPAGE + 38) ' Dimensione freccia
+ End Get
+ End Property
+ Public ReadOnly Property TextDistMsg As String
+ Get
+ Return EgtMsg(MSG_OPTIONPAGE + 39) ' Distanza messaggio
+ End Get
+ End Property
+ Public ReadOnly Property LenIsMMMsg As String
+ Get
+ Return EgtMsg(MSG_OPTIONPAGE + 40) ' Unità di misura
+ End Get
+ End Property
+ Public ReadOnly Property DecDigitMsg As String
+ Get
+ Return EgtMsg(MSG_OPTIONPAGE + 41) ' Numero dicmali
+ End Get
+ End Property
+ Public ReadOnly Property FontMsg As String
+ Get
+ Return EgtMsg(MSG_OPTIONPAGE + 42) ' Caretteri
+ End Get
+ End Property
+ Public ReadOnly Property TextHeightMsg As String
+ Get
+ Return EgtMsg(MSG_OPTIONPAGE + 43) ' Dimensione testo
+ End Get
+ End Property
Public ReadOnly Property ImportMsg As String
Get
@@ -716,52 +839,45 @@ Public Class OptionWindowVM
Return EgtMsg(MSG_OPTIONPAGE + 27) ' Aggiungi macchina
End Get
End Property
-
Public ReadOnly Property ExportMachineMsg As String
Get
Return EgtMsg(6549) ' Esporta macchina
End Get
End Property
- Public ReadOnly Property DimensionMsg As String
+ Public ReadOnly Property ExtraMsg As String
Get
- Return EgtMsg(MSG_OPTIONPAGE + 44) ' Quotatura
+ Return "Extra"
End Get
End Property
-
- Public ReadOnly Property ExtLineLenMsg As String
+ Public ReadOnly Property SpecialMsg As String
Get
- Return EgtMsg(MSG_OPTIONPAGE + 37) ' Estensione linea
+ Return "Special"
End Get
End Property
- Public ReadOnly Property ArrowLenMsg As String
+ Public ReadOnly Property BeamMsg As String
Get
- Return EgtMsg(MSG_OPTIONPAGE + 38) ' Dimensione freccia
+ Return "Beam"
End Get
End Property
- Public ReadOnly Property TextDistMsg As String
+ Public ReadOnly Property WallMsg As String
Get
- Return EgtMsg(MSG_OPTIONPAGE + 39) ' Distanza messaggio
+ Return "Wall"
End Get
End Property
- Public ReadOnly Property LenIsMMMsg As String
+ Public ReadOnly Property DoorsMsg As String
Get
- Return EgtMsg(MSG_OPTIONPAGE + 40) ' Unità di misura
+ Return "Doors"
End Get
End Property
- Public ReadOnly Property DecDigitMsg As String
+ Public ReadOnly Property GunstockMsg As String
Get
- Return EgtMsg(MSG_OPTIONPAGE + 41) ' Numero dicmali
+ Return "Gunstock"
End Get
End Property
- Public ReadOnly Property FontMsg As String
+ Public ReadOnly Property UpdateMsg As String
Get
- Return EgtMsg(MSG_OPTIONPAGE + 42) ' Caretteri
- End Get
- End Property
- Public ReadOnly Property TextHeightMsg As String
- Get
- Return EgtMsg(MSG_OPTIONPAGE + 43) ' Dimensione testo
+ Return EgtMsg(6554) ' Aggiorna
End Get
End Property
@@ -1173,6 +1289,213 @@ Public Class OptionWindowVM
#End Region ' ExportMachine
+#Region "UpdateBeam"
+ Public ReadOnly Property UpdateBeam_Command() As ICommand
+ Get
+ If m_cmdUpdateBeamCmd Is Nothing Then
+ m_cmdUpdateBeamCmd = New RelayCommand(AddressOf UpdateBeamCmd)
+ End If
+ Return m_cmdUpdateBeamCmd
+ End Get
+ End Property
+
+ Public Sub UpdateBeamCmd()
+ ' Recupero la versione del programma in esecuzione
+ Dim sExeVer As String = IniFile.GetProgramVersion()
+ ' Verifico presenza di una precedente installazione del Beam
+ Dim sBeamVer As String = ""
+ IniFile.GetSpecialLuaVersion( IniFile.m_sBeamDirPath, sBeamVer)
+ If String.IsNullOrEmpty( sBeamVer) Then
+ ' Il modulo "{0}" non è stato trovato, impossibile aggiornare. - Avviso
+ Dim sOut As String = String.Format(EgtMsg(6555), "Beam")
+ MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
+ ' Esco
+ Return
+ End If
+ ' Apro dialogo per richiesta file zip del Beam
+ Dim BeamDlg As New Microsoft.Win32.OpenFileDialog() With {
+ .DefaultExt = ".zip",
+ .Filter = "Beam (.zip)|*.zip",
+ .CheckFileExists = True,
+ .ValidateNames = True
+ }
+ If BeamDlg.ShowDialog() <> True Then Return
+ Dim sBeamZip As String = BeamDlg.FileName
+ ' Preparo direttorio temporaneo
+ Dim sTempDir As String = Path.Combine(IniFile.m_sTempDir, "Beam")
+ If My.Computer.FileSystem.DirectoryExists( sTempDir) Then
+ My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
+ End If
+ My.Computer.FileSystem.CreateDirectory( sTempDir)
+ ' Unzip nel direttorio temporaneo
+ Using zip As New Ionic.Zip.ZipFile(sBeamZip)
+ zip.ExtractAll( sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
+ End Using
+ ' Recupero i dati del nuovo Beam
+ Dim sNewName = ""
+ Dim sNewVer = ""
+ Dim sNewMinExe = ""
+ IniFile.GetSpecialLuaData( sTempDir, sNewName, sNewVer, sNewMinExe)
+ ' Verifico che sia veramente il Beam
+ If String.Compare(sNewName, "Beam") <> 0 Then
+ ' Il file zip non contiene il modulo "{0}". - Avviso
+ Dim sOut As String = String.Format(EgtMsg(6556), "Beam")
+ MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
+ ' Rimuovo il direttorio temporaneo ed esco
+ My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
+ Return
+ End If
+ ' Verifico la versione minima del programma
+ If String.Compare(sExeVer, sNewMinExe) < 0 Then
+ ' Il nuovo modulo "{0}" richiede un programma con versione minima {1}. - Avviso
+ Dim sOut As String = String.Format(EgtMsg(6557), "Beam", sNewMinExe)
+ MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
+ ' Rimuovo il direttorio temporaneo ed esco
+ My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
+ Return
+ End If
+ ' Verifico la versione del Beam e se più vecchia chiedo cosa fare
+ If String.Compare(sNewVer, sBeamVer) < 0 Then
+ ' La versione del nuovo modulo "{0}" è più vecchia dell'attuale. Vuoi sovrascrivere lo stesso ?
+ Dim sOut As String = String.Format(EgtMsg(6558), "Beam")
+ if MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15003), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.No Then
+ ' Rimuovo il direttorio temporaneo ed esco
+ My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
+ Return
+ End If
+ End If
+ ' Faccio una copia di backup del Beam corrente
+ Dim sBackupDir As String = IniFile.m_sBeamDirPath & ".old"
+ If My.Computer.FileSystem.DirectoryExists( sBackupDir) Then
+ My.Computer.FileSystem.DeleteDirectory( sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
+ End If
+ Try
+ My.Computer.FileSystem.MoveDirectory( IniFile.m_sBeamDirPath, sBackupDir, True)
+ Catch ex As Exception
+ ' Ripristino lo stato originale ed esco
+ My.Computer.FileSystem.MoveDirectory( sBackupDir, IniFile.m_sBeamDirPath, True)
+ ' L'aggiornamento del modulo "{0}" non è riuscito. - Errore
+ Dim sOut As String = String.Format(EgtMsg(6559), "Beam")
+ EgtOutLog( sOut)
+ MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15001), MessageBoxButton.OK, MessageBoxImage.Error)
+ ' Rimuovo il direttorio temporaneo ed esco
+ My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
+ Return
+ End Try
+ ' Installo il Beam
+ My.Computer.FileSystem.MoveDirectory( sTempDir, IniFile.m_sBeamDirPath, True)
+ ' Il modulo "{0}" è stata aggiornato con successo. - Info
+ Dim sOk As String = String.Format(EgtMsg(6560), "Beam")
+ EgtOutLog( sOk)
+ MessageBox.Show(Application.Current.MainWindow, sOk, EgtMsg(15003), MessageBoxButton.OK)
+ End Sub
+
+#End Region ' UpdateBeam
+
+
+#Region "UpdateWall"
+ Public ReadOnly Property UpdateWall_Command() As ICommand
+ Get
+ If m_cmdUpdateWallCmd Is Nothing Then
+ m_cmdUpdateWallCmd = New RelayCommand(AddressOf UpdateWallCmd)
+ End If
+ Return m_cmdUpdateWallCmd
+ End Get
+ End Property
+
+ Public Sub UpdateWallCmd()
+ ' Recupero la versione del programma in esecuzione
+ Dim sExeVer As String = IniFile.GetProgramVersion()
+ ' Verifico presenza di una precedente installazione del Wall
+ Dim sWallVer As String = ""
+ IniFile.GetSpecialLuaVersion( IniFile.m_sWallDirPath, sWallVer)
+ If String.IsNullOrEmpty( sWallVer) Then
+ ' Il modulo "{0}" non è stato trovato, impossibile aggiornare. - Avviso
+ Dim sOut As String = String.Format(EgtMsg(6555), "Wall")
+ MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
+ ' Esco
+ Return
+ End If
+ ' Apro dialogo per richiesta file zip del Wall
+ Dim WallDlg As New Microsoft.Win32.OpenFileDialog() With {
+ .DefaultExt = ".zip",
+ .Filter = "Wall (.zip)|*.zip",
+ .CheckFileExists = True,
+ .ValidateNames = True
+ }
+ If WallDlg.ShowDialog() <> True Then Return
+ Dim sWallZip As String = WallDlg.FileName
+ ' Preparo direttorio temporaneo
+ Dim sTempDir As String = Path.Combine(IniFile.m_sTempDir, "Wall")
+ If My.Computer.FileSystem.DirectoryExists( sTempDir) Then
+ My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
+ End If
+ My.Computer.FileSystem.CreateDirectory( sTempDir)
+ ' Unzip nel direttorio temporaneo
+ Using zip As New Ionic.Zip.ZipFile(sWallZip)
+ zip.ExtractAll( sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
+ End Using
+ ' Recupero i dati del nuovo Wall
+ Dim sNewName = ""
+ Dim sNewVer = ""
+ Dim sNewMinExe = ""
+ IniFile.GetSpecialLuaData( sTempDir, sNewName, sNewVer, sNewMinExe)
+ ' Verifico che sia veramente il Wall
+ If String.Compare(sNewName, "Wall") <> 0 Then
+ ' Il file zip non contiene il modulo "{0}". - Avviso
+ Dim sOut As String = String.Format(EgtMsg(6556), "Wall")
+ MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
+ ' Rimuovo il direttorio temporaneo ed esco
+ My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
+ Return
+ End If
+ ' Verifico la versione minima del programma
+ If String.Compare(sExeVer, sNewMinExe) < 0 Then
+ ' Il nuovo modulo "{0}" richiede un programma con versione minima {1}. - Avviso
+ Dim sOut As String = String.Format(EgtMsg(6557), "Wall", sNewMinExe)
+ MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
+ ' Rimuovo il direttorio temporaneo ed esco
+ My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
+ Return
+ End If
+ ' Verifico la versione del Wall e se più vecchia chiedo cosa fare
+ If String.Compare(sNewVer, sWallVer) < 0 Then
+ ' La versione del nuovo modulo "{0}" è più vecchia dell'attuale. Vuoi sovrascrivere lo stesso ?
+ Dim sOut As String = String.Format(EgtMsg(6558), "Wall")
+ if MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15003), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.No Then
+ ' Rimuovo il direttorio temporaneo ed esco
+ My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
+ Return
+ End If
+ End If
+ ' Faccio una copia di backup del Wall corrente
+ Dim sBackupDir As String = IniFile.m_sWallDirPath & ".old"
+ If My.Computer.FileSystem.DirectoryExists( sBackupDir) Then
+ My.Computer.FileSystem.DeleteDirectory( sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
+ End If
+ Try
+ My.Computer.FileSystem.MoveDirectory( IniFile.m_sWallDirPath, sBackupDir, True)
+ Catch ex As Exception
+ ' Ripristino lo stato originale ed esco
+ My.Computer.FileSystem.MoveDirectory( sBackupDir, IniFile.m_sWallDirPath, True)
+ ' L'aggiornamento del modulo "{0}" non è riuscito. - Errore
+ Dim sOut As String = String.Format(EgtMsg(6559), "Wall")
+ EgtOutLog( sOut)
+ MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15001), MessageBoxButton.OK, MessageBoxImage.Error)
+ ' Rimuovo il direttorio temporaneo ed esco
+ My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
+ Return
+ End Try
+ ' Installo il Wall
+ My.Computer.FileSystem.MoveDirectory( sTempDir, IniFile.m_sWallDirPath, True)
+ ' Il modulo "{0}" è stata aggiornato con successo. - Info
+ Dim sOk As String = String.Format(EgtMsg(6560), "Wall")
+ EgtOutLog( sOk)
+ MessageBox.Show(Application.Current.MainWindow, sOk, EgtMsg(15003), MessageBoxButton.OK)
+ End Sub
+
+#End Region ' UpdateWall
+
#Region "CloseOptionsCommand"
'''
diff --git a/SpecialPanel/SpecialPanelVM.vb b/SpecialPanel/SpecialPanelVM.vb
index 1984495..09d6a66 100644
--- a/SpecialPanel/SpecialPanelVM.vb
+++ b/SpecialPanel/SpecialPanelVM.vb
@@ -100,9 +100,12 @@ Public Class ButtonItem
Private m_cmdLuaExec As ICommand
Sub New( sBarName As String, sLuaCmdPath As String, sImagePath As String, sToolTip As String, sDrawMachOrBoth As String)
- m_sBarName = sBarName
- If File.Exists(sImagePath) Then
- m_sImagePath = sImagePath
+ m_sBarName = sBarName
+ If File.Exists(sImagePath) Then
+ ' per lasciare libere le immagini le copio
+ Dim sNewPath As String = Path.Combine(IniFile.m_sResourcesRoot, sBarName & "_" & Path.GetFileName( sImagePath))
+ File.Copy( sImagePath, sNewPath, True)
+ m_sImagePath = sNewPath
Else
m_sImagePath = IniFile.m_sResourcesRoot & "\" & sImagePath
End If
diff --git a/Utility/IniFile.vb b/Utility/IniFile.vb
index 0e5cc3b..2427e7c 100644
--- a/Utility/IniFile.vb
+++ b/Utility/IniFile.vb
@@ -251,6 +251,13 @@ Public Module IniFile
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, sColor, m_sIniFile)
End Function
+ Friend Function GetProgramVersion() As String
+ Return My.Application.Info.Version.Major.ToString() &
+ "." & My.Application.Info.Version.Minor.ToString() &
+ (ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
+ My.Application.Info.Version.Revision.ToString()
+ End Function
+
Friend Function IsActiveBeam() As Boolean
Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT.BEAM) <> 0 And (GetPrivateProfileInt(S_BEAM, K_BEAMENABLE, 0) <> 0)
If bIsActive Then
@@ -318,4 +325,17 @@ Public Module IniFile
Return True
End Function
+ Friend Function GetSpecialLuaData( sSpecialLuaDir As String,
+ ByRef sName As String, ByRef sVersion As String, ByRef sMinExe As String) As Boolean
+ Dim sExecPath As String = (sSpecialLuaDir & "\Version.lua")
+ If Not EgtLuaExecFile(sExecPath, False) Then Return False
+ If Not EgtLuaGetGlobStringVar("NAME", sName) Then Return False
+ If Not EgtLuaGetGlobStringVar("VERSION", sVersion) Then Return False
+ If Not EgtLuaGetGlobStringVar("MIN_EXE", sMinExe) Then Return False
+ EgtLuaResetGlobVar("NAME")
+ EgtLuaResetGlobVar("VERSION")
+ EgtLuaResetGlobVar("MIN_EXE")
+ Return True
+ End Function
+
End Module