Skip to content

Commit 391dfa3

Browse files
committed
Small build/operation changes
- Disabled deployment building for now, that is coming later - Removed temporary signing key - Some initial logging statement changes - Fixed menu bar not updating correctly on first run - Once again changed logging location - now stored in the local appdata along with the configuration file
1 parent b722db2 commit 391dfa3

File tree

9 files changed

+27
-61
lines changed

9 files changed

+27
-61
lines changed

Diff for: WinNUT_V2/WinNUT-Client/ApplicationEvents.vb

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
' This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY
99

1010
Imports System.Configuration
11+
Imports System.Deployment.Application
1112
Imports System.Globalization
1213
Imports System.IO
1314
Imports System.Text.RegularExpressions
@@ -42,6 +43,9 @@ Namespace My
4243
' AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf AppDomainUnhandledException
4344

4445
Init_Globals()
46+
LogFile.LogTracing(String.Format("{0} v{1} starting up.", My.Application.Info.ProductName, My.Application.Info.Version),
47+
LogLvl.LOG_NOTICE, Me)
48+
' LogFile.LogTracing($"DataDirectory: { ApplicationDeployment.CurrentDeployment.DataDirectory }", LogLvl.LOG_NOTICE, Me)
4549

4650
' If first run indicated by Settings, attempt upgrade in case older version is present.
4751
' Only necessary when deploying MSI. Remove once using pure ClickOnce.

Diff for: WinNUT_V2/WinNUT-Client/My Project/app.manifest

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
3-
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
3+
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
44
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
55
<security>
66
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
@@ -18,33 +18,29 @@
1818
-->
1919
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
2020
</requestedPrivileges>
21+
<applicationRequestMinimum>
22+
<defaultAssemblyRequest permissionSetReference="Custom" />
23+
<PermissionSet ID="Custom" SameSite="site" Unrestricted="true" />
24+
</applicationRequestMinimum>
2125
</security>
2226
</trustInfo>
23-
2427
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
2528
<application>
2629
<!-- Liste des versions de Windows pour lesquelles cette application a été testée,
2730
et sur lesquelles elle doit fonctionner. Décommentez éléments appropriés,
2831
et Windows va automatiquement sélectionner l'environnement le plus compatible. -->
29-
3032
<!-- Windows Vista -->
3133
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
32-
3334
<!-- Windows 7 -->
3435
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
35-
3636
<!-- Windows 8 -->
3737
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
38-
3938
<!-- Windows 8.1 -->
4039
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
41-
4240
<!-- Windows 10 -->
4341
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
44-
4542
</application>
4643
</compatibility>
47-
4844
<!-- Indique que l'application prend en charge DPI et qu'elle n'est pas automatiquement mise à l'échelle par Windows à un niveau de
4945
DPI plus élevé. Les applications Windows Presentation Foundation (WPF) prennent automatiquement en charge DPI et n'ont pas besoin
5046
d'opter pour ce choix. Les applications Windows Forms qui ciblent .NET Framework 4.6 et qui optent pour ce paramètre, doivent
@@ -56,7 +52,6 @@
5652
</windowsSettings>
5753
</application>
5854
-->
59-
6055
<!-- Activer les thèmes pour les contrôles et boîtes de dialogue communes de Windows (Windows XP et version ultérieure) -->
6156
<!--
6257
<dependency>
@@ -72,5 +67,4 @@
7267
</dependentAssembly>
7368
</dependency>
7469
-->
75-
76-
</assembly>
70+
</assembly>

Diff for: WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1515
<IsWebBootstrapper>false</IsWebBootstrapper>
1616
<TargetFrameworkProfile />
17-
<PublishUrl>
18-
</PublishUrl>
17+
<PublishUrl>publish\</PublishUrl>
1918
<Install>true</Install>
2019
<InstallFrom>Disk</InstallFrom>
2120
<UpdateEnabled>false</UpdateEnabled>
@@ -28,7 +27,6 @@
2827
<ApplicationRevision>1</ApplicationRevision>
2928
<ApplicationVersion>2.2.0.%2a</ApplicationVersion>
3029
<UseApplicationTrust>false</UseApplicationTrust>
31-
<PublishWizardCompleted>true</PublishWizardCompleted>
3230
<BootstrapperEnabled>false</BootstrapperEnabled>
3331
</PropertyGroup>
3432
<PropertyGroup>
@@ -45,8 +43,7 @@
4543
</DocumentationFile>
4644
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
4745
<Optimize>false</Optimize>
48-
<DefineConstants>
49-
</DefineConstants>
46+
<DefineConstants>TEST_RELEASE_DIRS=True</DefineConstants>
5047
</PropertyGroup>
5148
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
5249
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -91,7 +88,7 @@
9188
<ManifestKeyFile>WinNUT-client_TemporaryKey.pfx</ManifestKeyFile>
9289
</PropertyGroup>
9390
<PropertyGroup>
94-
<GenerateManifests>true</GenerateManifests>
91+
<GenerateManifests>false</GenerateManifests>
9592
</PropertyGroup>
9693
<PropertyGroup>
9794
<SignManifests>false</SignManifests>
@@ -110,6 +107,10 @@
110107
<PlatformTarget>AnyCPU</PlatformTarget>
111108
<Prefer32Bit>true</Prefer32Bit>
112109
<DebugSymbols>true</DebugSymbols>
110+
<DefineDebug>false</DefineDebug>
111+
</PropertyGroup>
112+
<PropertyGroup>
113+
<TargetZone>LocalIntranet</TargetZone>
113114
</PropertyGroup>
114115
<ItemGroup>
115116
<Reference Include="System" />
@@ -390,7 +391,6 @@
390391
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
391392
</None>
392393
<None Include="App.config" />
393-
<None Include="WinNUT-client_TemporaryKey.pfx" />
394394
</ItemGroup>
395395
<ItemGroup>
396396
<None Include="Resources\1025.ico" />
-1.66 KB
Binary file not shown.

Diff for: WinNUT_V2/WinNUT-Client/WinNUT.vb

+2-1
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ Public Class WinNUT
189189
' Start_Tray_Icon = Nothing
190190

191191
ApplyApplicationPreferences()
192+
UpdateMainMenuState()
192193

193194
' If this is the first time WinNUT has been launched with the Settings system, check if old preferences exist
194195
' and prompt the user to upgrade.
@@ -212,7 +213,7 @@ Public Class WinNUT
212213
AddHandler RequestConnect, AddressOf UPS_Connect
213214
AddHandler My.Settings.PropertyChanged, AddressOf SettingsPropertyChanged
214215

215-
LogFile.LogTracing(String.Format("{0} v{1} completed initialization.", My.Application.Info.ProductName, My.Application.Info.Version),
216+
LogFile.LogTracing(String.Format("WinNUT Form completed Load.", My.Application.Info.ProductName, My.Application.Info.Version),
216217
LogLvl.LOG_NOTICE, Me)
217218
End Sub
218219

Diff for: WinNUT_V2/WinNUT-Client_Common/Logger.vb

+6-11
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
Imports System.Globalization
1111
Imports System.IO
1212
Imports System.Text
13+
Imports System.Windows.Forms
1314
Imports Microsoft.VisualBasic.Logging
1415

1516
Public Class Logger
@@ -22,8 +23,7 @@ Public Class Logger
2223
Private Shared ReadOnly DEFAULT_LOCATION = LogFileLocation.ExecutableDirectory
2324
#Else
2425
Private Shared ReadOnly DEFAULT_DATETIMEFORMAT = DateTimeFormatInfo.CurrentInfo
25-
' Actually goes to the Roaming folder.
26-
Private Shared ReadOnly DEFAULT_LOCATION = LogFileLocation.LocalUserApplicationDirectory
26+
Private Shared ReadOnly DEFAULT_LOCATION = Application.LocalUserAppDataPath
2727
#End If
2828

2929
Private ReadOnly TEventCache As New TraceEventCache()
@@ -135,17 +135,12 @@ Public Class Logger
135135
.TraceOutputOptions = TraceOptions.DateTime Or TraceOptions.ProcessId,
136136
.Append = True,
137137
.AutoFlush = True,
138-
.LogFileCreationSchedule = LOG_FILE_CREATION_SCHEDULE
138+
.LogFileCreationSchedule = LOG_FILE_CREATION_SCHEDULE,
139+
.CustomLocation = If(baseDataFolder Is Nothing, DEFAULT_LOCATION, baseDataFolder),
140+
.Location = LogFileLocation.Custom
139141
}
140142

141-
If baseDataFolder Is Nothing Then
142-
LogFile.Location = DEFAULT_LOCATION
143-
Else
144-
LogFile.Location = LogFileLocation.Custom
145-
LogFile.CustomLocation = baseDataFolder
146-
End If
147-
148-
LogTracing(String.Format("{0} {1} Log file init", ProgramName, ProgramVersion), LogLvl.LOG_NOTICE, Me)
143+
LogTracing($"Init log file: { LogFilePath }", LogLvl.LOG_NOTICE, Me)
149144

150145
If LastEventsList.Count > 0 Then
151146
' Fill new file with the LastEventsList buffer

Diff for: WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
<ItemGroup>
6464
<Reference Include="System" />
6565
<Reference Include="System.Data" />
66+
<Reference Include="System.Deployment" />
6667
<Reference Include="System.Drawing" />
6768
<Reference Include="System.Management" />
6869
<Reference Include="System.Security" />

Diff for: WinNUT_V2/WinNUT-Client_Common/WinNUT_Globals.vb

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Public Module WinNUT_Globals
1616
Public ReadOnly ShortProgramVersion = ProgramVersion.Substring(0, ProgramVersion.IndexOf(".", ProgramVersion.IndexOf(".") + 1))
1717
Public ReadOnly GitHubURL = My.Application.Info.Trademark
1818
Public ReadOnly Copyright = My.Application.Info.Copyright
19+
Public ReadOnly DataDirectory = $"{ My.Application.Info.CompanyName }\{ ProgramName }\{ ProgramVersion }"
1920

2021
Public WithEvents LogFile As Logger = New Logger(LogLvl.LOG_DEBUG)
2122
Public StrLog As New List(Of String)

Diff for: WinNUT_V2/WinNUT_V2.sln

-30
Original file line numberDiff line numberDiff line change
@@ -91,36 +91,6 @@ Global
9191
{FAFFBA8B-E9DB-419E-9669-999E8EFEFCB5}.Release|x64.Build.0 = Release
9292
{FAFFBA8B-E9DB-419E-9669-999E8EFEFCB5}.Release|x86.ActiveCfg = Release
9393
{FAFFBA8B-E9DB-419E-9669-999E8EFEFCB5}.Release|x86.Build.0 = Release
94-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
95-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
96-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Debug|ARM.ActiveCfg = Debug|Any CPU
97-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Debug|ARM.Build.0 = Debug|Any CPU
98-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Debug|ARM64.ActiveCfg = Debug|Any CPU
99-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Debug|ARM64.Build.0 = Debug|Any CPU
100-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Debug|x64.ActiveCfg = Debug|Any CPU
101-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Debug|x64.Build.0 = Debug|Any CPU
102-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Debug|x86.ActiveCfg = Debug|Any CPU
103-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Debug|x86.Build.0 = Debug|Any CPU
104-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.PreRelease|Any CPU.ActiveCfg = Release|Any CPU
105-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.PreRelease|Any CPU.Build.0 = Release|Any CPU
106-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.PreRelease|ARM.ActiveCfg = Release|Any CPU
107-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.PreRelease|ARM.Build.0 = Release|Any CPU
108-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.PreRelease|ARM64.ActiveCfg = Release|Any CPU
109-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.PreRelease|ARM64.Build.0 = Release|Any CPU
110-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.PreRelease|x64.ActiveCfg = Release|Any CPU
111-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.PreRelease|x64.Build.0 = Release|Any CPU
112-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.PreRelease|x86.ActiveCfg = Release|Any CPU
113-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.PreRelease|x86.Build.0 = Release|Any CPU
114-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
115-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Release|Any CPU.Build.0 = Release|Any CPU
116-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Release|ARM.ActiveCfg = Release|Any CPU
117-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Release|ARM.Build.0 = Release|Any CPU
118-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Release|ARM64.ActiveCfg = Release|Any CPU
119-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Release|ARM64.Build.0 = Release|Any CPU
120-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Release|x64.ActiveCfg = Release|Any CPU
121-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Release|x64.Build.0 = Release|Any CPU
122-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Release|x86.ActiveCfg = Release|Any CPU
123-
{CBDB1D25-5A95-43D4-A958-BF6AE65C6C3F}.Release|x86.Build.0 = Release|Any CPU
12494
{9074CE60-DB9A-4BDF-B851-6EAB8A81F366}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12595
{9074CE60-DB9A-4BDF-B851-6EAB8A81F366}.Debug|Any CPU.Build.0 = Debug|Any CPU
12696
{9074CE60-DB9A-4BDF-B851-6EAB8A81F366}.Debug|ARM.ActiveCfg = Debug|Any CPU

0 commit comments

Comments
 (0)