Skip to content

Commit 9e45f1d

Browse files
committed
Enhanced StartMenu Items Retrival and Display
- Optmized start menu icons refresh - Fixed damaged shortcuts bug
1 parent ddaaaeb commit 9e45f1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+903
-689
lines changed

Metro Tile Customizer/Core.vb

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Imports System.IO
2+
Imports System.Xml
3+
4+
Module ColorBoxes
5+
Public Main As New List(Of Control)
6+
Public Accents As New List(Of Control)
7+
Public Other As New List(Of Control)
8+
End Module
9+
10+
Module Core
11+
Public ProgramDataItems = Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu) & "\Programs", "*.lnk", SearchOption.AllDirectories)
12+
Public AppDataItems = Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) & "\Programs", "*.lnk", SearchOption.AllDirectories)
13+
Public StartMenuItems As New DataTable
14+
15+
Sub New()
16+
StartMenuItems.Columns.Add("path")
17+
StartMenuItems.Columns.Add("name")
18+
End Sub
19+
20+
Public Function AppData(Optional Path As String = Nothing)
21+
Return String.Join("\", My.Computer.FileSystem.SpecialDirectories.Temp & "\MetroTileChanger", Path)
22+
End Function
23+
24+
Public Sub GetStartMenuItems()
25+
StartMenuItems.Rows.Clear()
26+
27+
For Each Item In AppDataItems
28+
StartMenuItems.Rows.Add(Item, Path.GetFileNameWithoutExtension(Item))
29+
Next
30+
For Each Item In ProgramDataItems
31+
StartMenuItems.Rows.Add(Item, Path.GetFileNameWithoutExtension(Item))
32+
Next
33+
StartMenuItems.DefaultView.Sort = "name asc"
34+
End Sub
35+
End Module
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Weavers>
3-
<Costura>
4-
<IncludeAssemblies>
5-
MetroFramework
6-
MetroFramework.Design
7-
MetroFramework.Fonts
8-
</IncludeAssemblies>
9-
</Costura>
2+
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
3+
<Costura CreateTemporaryAssemblies="true" DisableCompression="true" />
104
</Weavers>
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
3+
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
4+
<xs:element name="Weavers">
5+
<xs:complexType>
6+
<xs:all>
7+
<xs:element name="Costura" minOccurs="0" maxOccurs="1">
8+
<xs:complexType>
9+
<xs:all>
10+
<xs:element minOccurs="0" maxOccurs="1" name="ExcludeAssemblies" type="xs:string">
11+
<xs:annotation>
12+
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation>
13+
</xs:annotation>
14+
</xs:element>
15+
<xs:element minOccurs="0" maxOccurs="1" name="IncludeAssemblies" type="xs:string">
16+
<xs:annotation>
17+
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
18+
</xs:annotation>
19+
</xs:element>
20+
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged32Assemblies" type="xs:string">
21+
<xs:annotation>
22+
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with line breaks.</xs:documentation>
23+
</xs:annotation>
24+
</xs:element>
25+
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged64Assemblies" type="xs:string">
26+
<xs:annotation>
27+
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with line breaks.</xs:documentation>
28+
</xs:annotation>
29+
</xs:element>
30+
<xs:element minOccurs="0" maxOccurs="1" name="PreloadOrder" type="xs:string">
31+
<xs:annotation>
32+
<xs:documentation>The order of preloaded assemblies, delimited with line breaks.</xs:documentation>
33+
</xs:annotation>
34+
</xs:element>
35+
</xs:all>
36+
<xs:attribute name="CreateTemporaryAssemblies" type="xs:boolean">
37+
<xs:annotation>
38+
<xs:documentation>This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file.</xs:documentation>
39+
</xs:annotation>
40+
</xs:attribute>
41+
<xs:attribute name="IncludeDebugSymbols" type="xs:boolean">
42+
<xs:annotation>
43+
<xs:documentation>Controls if .pdbs for reference assemblies are also embedded.</xs:documentation>
44+
</xs:annotation>
45+
</xs:attribute>
46+
<xs:attribute name="DisableCompression" type="xs:boolean">
47+
<xs:annotation>
48+
<xs:documentation>Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.</xs:documentation>
49+
</xs:annotation>
50+
</xs:attribute>
51+
<xs:attribute name="DisableCleanup" type="xs:boolean">
52+
<xs:annotation>
53+
<xs:documentation>As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.</xs:documentation>
54+
</xs:annotation>
55+
</xs:attribute>
56+
<xs:attribute name="LoadAtModuleInit" type="xs:boolean">
57+
<xs:annotation>
58+
<xs:documentation>Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code.</xs:documentation>
59+
</xs:annotation>
60+
</xs:attribute>
61+
<xs:attribute name="IgnoreSatelliteAssemblies" type="xs:boolean">
62+
<xs:annotation>
63+
<xs:documentation>Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior.</xs:documentation>
64+
</xs:annotation>
65+
</xs:attribute>
66+
<xs:attribute name="ExcludeAssemblies" type="xs:string">
67+
<xs:annotation>
68+
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation>
69+
</xs:annotation>
70+
</xs:attribute>
71+
<xs:attribute name="IncludeAssemblies" type="xs:string">
72+
<xs:annotation>
73+
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
74+
</xs:annotation>
75+
</xs:attribute>
76+
<xs:attribute name="Unmanaged32Assemblies" type="xs:string">
77+
<xs:annotation>
78+
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with |.</xs:documentation>
79+
</xs:annotation>
80+
</xs:attribute>
81+
<xs:attribute name="Unmanaged64Assemblies" type="xs:string">
82+
<xs:annotation>
83+
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with |.</xs:documentation>
84+
</xs:annotation>
85+
</xs:attribute>
86+
<xs:attribute name="PreloadOrder" type="xs:string">
87+
<xs:annotation>
88+
<xs:documentation>The order of preloaded assemblies, delimited with |.</xs:documentation>
89+
</xs:annotation>
90+
</xs:attribute>
91+
</xs:complexType>
92+
</xs:element>
93+
</xs:all>
94+
<xs:attribute name="VerifyAssembly" type="xs:boolean">
95+
<xs:annotation>
96+
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
97+
</xs:annotation>
98+
</xs:attribute>
99+
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
100+
<xs:annotation>
101+
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
102+
</xs:annotation>
103+
</xs:attribute>
104+
<xs:attribute name="GenerateXsd" type="xs:boolean">
105+
<xs:annotation>
106+
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
107+
</xs:annotation>
108+
</xs:attribute>
109+
</xs:complexType>
110+
</xs:element>
111+
</xs:schema>

Metro Tile Customizer/LnkFile.vb

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
Imports Shell32
2+
Imports System.IO
3+
Imports System.IO.Path
4+
Imports System.Text.RegularExpressions
5+
6+
Public Class LnkFile
7+
Public Property Path As String
8+
9+
Public ReadOnly Property Target As String
10+
Get
11+
Dim Obj As Object
12+
Obj = CreateObject("WScript.Shell")
13+
Dim Shortcut As Object
14+
Shortcut = Obj.CreateShortcut(Path)
15+
Dim TargetPath As String = Shortcut.TargetPath
16+
If File.Exists(TargetPath) Then
17+
Return TargetPath
18+
Else
19+
Return TargetPath.Replace("Program Files (x86)", "Program Files")
20+
End If
21+
End Get
22+
End Property
23+
24+
Public ReadOnly Property TargetIcon
25+
Get
26+
Try
27+
Return Icon.ExtractAssociatedIcon(Target).ToBitmap()
28+
Catch ex As Exception
29+
Return Nothing
30+
End Try
31+
End Get
32+
End Property
33+
34+
Public ReadOnly Property VisualManifest As String
35+
Get
36+
Return Regex.Replace(Target, "\.[E|e][X|x][E|e]", ".visualelementsmanifest.xml")
37+
End Get
38+
End Property
39+
40+
Public ReadOnly Property Name As String
41+
Get
42+
Return GetFileNameWithoutExtension(Path)
43+
End Get
44+
End Property
45+
46+
Public Sub New(Path As String)
47+
Me.Path = Path
48+
End Sub
49+
50+
Public Sub Refresh()
51+
File.SetLastWriteTime(Path, Now)
52+
End Sub
53+
End Class

0 commit comments

Comments
 (0)