Skip to content

Commit 75c9267

Browse files
committed
Reorganized pre run commands
1 parent 8c72dee commit 75c9267

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

Commands/NugetCleanup.Command.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Commands>
2+
<Command Processed="false">
3+
<PreChecks>
4+
<PreCheck type="FileExists">Nuget.Common.dll</PreCheck>
5+
<PreCheck type="FileExists">XrmToolBox.PluginsStore.dll</PreCheck>
6+
</PreChecks>
7+
<Description>This version of XrmToolBox removes the legacy tool library. Nuget assemblies are not needed anymore and will be deleted.</Description>
8+
<Actions>
9+
<Action>IF EXIST "Nuget.Common.dll" (DEL "Nuget.Common.dll")</Action>
10+
<Action>IF EXIST "Nuget.Configuration.dll" (DEL "Nuget.Configuration.dll")</Action>
11+
<Action>IF EXIST "Nuget.Core.dll" (DEL "Nuget.Core.dll")</Action>
12+
<Action>IF EXIST "Nuget.Frameworks.dll" (DEL "Nuget.Frameworks.dll")</Action>
13+
<Action>IF EXIST "Nuget.Packaging.dll" (DEL "Nuget.Packaging.dll")</Action>
14+
<Action>IF EXIST "Nuget.Protocol.dll" (DEL "Nuget.Protocol.dll")</Action>
15+
<Action>IF EXIST "Nuget.Versioning.dll" (DEL "Nuget.Versioning.dll")</Action>
16+
<Action>IF EXIST "XrmToolBox.PluginsStore.dll" (DEL "XrmToolBox.PluginsStore.dll")</Action>
17+
</Actions>
18+
</Command>
19+
</Commands>

XrmToolBox.AutoUpdater/AutoUpdater.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ private void btnLaunchXrmToolBox_Click(object sender, EventArgs e)
118118
catch (Exception error)
119119
{
120120
MessageBox.Show(this,
121-
$@"Unable to start XrmToolBox for the following reason: {error.Message}. File not found : {
122-
xtbPath
123-
}", @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
121+
$@"Unable to start XrmToolBox for the following reason: {error.Message}. File not found : {xtbPath}", @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
124122
}
125123
}
126124

@@ -189,6 +187,12 @@ private void CopyDirectoryContent(string directoryPath, string destinationDirect
189187
var directory = new DirectoryInfo(directoryPath);
190188
foreach (var fi in directory.GetFiles())
191189
{
190+
if (fi.FullName.ToLower().EndsWith(".command.xml") && File.Exists(Path.Combine(destinationDirectoryPath, fi.Name)))
191+
{
192+
// If the file already exists, we skip it
193+
continue;
194+
}
195+
192196
worker.ReportProgress(0, action + " " + fi.Name);
193197

194198
fi.CopyTo(Path.Combine(destinationDirectoryPath, fi.Name), true);

0 commit comments

Comments
 (0)