根据安装程序的要求,更新项目文件,目标平台为x64,项目设置为Release

This commit is contained in:
tian 2025-11-18 18:27:40 +08:00
parent fee00dfb82
commit ca4488dcb8
8 changed files with 361 additions and 126 deletions

View File

@ -70,13 +70,13 @@
<!-- 引用主项目的编译输出 -->
<ItemGroup>
<Reference Include="NavisworksTransportPlugin">
<HintPath>bin\Debug\NavisworksTransportPlugin.dll</HintPath>
<HintPath>bin\x64\Debug\NavisworksTransportPlugin.dll</HintPath>
<Private>True</Private>
</Reference>
<!-- Roy_T.AStar for A* algorithm testing -->
<Reference Include="Roy-T.AStar">
<HintPath>packages\RoyT.AStar.2.1.0\lib\netstandard2.0\Roy-T.AStar.dll</HintPath>
<HintPath>packages\RoyT.AStar.3.0.2\lib\netstandard2.0\Roy-T.AStar.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>

View File

@ -5,16 +5,30 @@ VisualStudioVersion = 17.14.36203.30
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NavisworksTransportPlugin", "NavisworksTransportPlugin.csproj", "{1A0124F6-3DEB-4153-8760-F568AD9393EE}"
EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "NavisworksTransport.Setup", "..\NavisworksTransport.Setup\NavisworksTransport.Setup.vdproj", "{E1955F72-A686-9398-1C6A-936493D9211F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1A0124F6-3DEB-4153-8760-F568AD9393EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A0124F6-3DEB-4153-8760-F568AD9393EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A0124F6-3DEB-4153-8760-F568AD9393EE}.Debug|x64.ActiveCfg = Debug|x64
{1A0124F6-3DEB-4153-8760-F568AD9393EE}.Debug|x64.Build.0 = Debug|x64
{1A0124F6-3DEB-4153-8760-F568AD9393EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A0124F6-3DEB-4153-8760-F568AD9393EE}.Release|Any CPU.Build.0 = Release|Any CPU
{1A0124F6-3DEB-4153-8760-F568AD9393EE}.Release|x64.ActiveCfg = Release|x64
{1A0124F6-3DEB-4153-8760-F568AD9393EE}.Release|x64.Build.0 = Release|x64
{E1955F72-A686-9398-1C6A-936493D9211F}.Debug|Any CPU.ActiveCfg = Debug
{E1955F72-A686-9398-1C6A-936493D9211F}.Debug|x64.ActiveCfg = Debug
{E1955F72-A686-9398-1C6A-936493D9211F}.Debug|x64.Build.0 = Debug
{E1955F72-A686-9398-1C6A-936493D9211F}.Release|Any CPU.ActiveCfg = Release
{E1955F72-A686-9398-1C6A-936493D9211F}.Release|x64.ActiveCfg = Release
{E1955F72-A686-9398-1C6A-936493D9211F}.Release|x64.Build.0 = Release
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
<ProjectGuid>{1A0124F6-3DEB-4153-8760-F568AD9393EE}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
@ -14,27 +13,24 @@
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NAVISWORKS_2026</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NAVISWORKS_2026</DefineConstants>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NAVISWORKS_2026</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<!-- Navisworks 2026 API References -->
<Reference Include="Autodesk.Navisworks.Api">
@ -53,7 +49,6 @@
<HintPath>..\..\..\..\Program Files\Autodesk\Navisworks Manage 2026\Autodesk.Navisworks.Controls.dll</HintPath>
<Private>False</Private>
</Reference>
<!-- COM API References for 2026 -->
<Reference Include="Autodesk.Navisworks.ComApi">
<HintPath>..\..\..\..\Program Files\Autodesk\Navisworks Manage 2026\Autodesk.Navisworks.ComApi.dll</HintPath>
@ -64,8 +59,6 @@
<EmbedInteropTypes>False</EmbedInteropTypes>
<Private>False</Private>
</Reference>
<!-- System References -->
<Reference Include="System" />
<Reference Include="System.Core" />
@ -78,47 +71,39 @@
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<!-- WPF References -->
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="WindowsBase" />
<Reference Include="System.Xaml" />
<Reference Include="WindowsFormsIntegration" />
<!-- RoyT.AStar NuGet Package -->
<Reference Include="Roy-T.AStar, Version=3.0.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\RoyT.AStar.3.0.2\lib\netstandard2.0\Roy-T.AStar.dll</HintPath>
<Private>True</Private>
</Reference>
<!-- System.Data.SQLite NuGet Package -->
<Reference Include="System.Data.SQLite">
<HintPath>packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\lib\net46\System.Data.SQLite.dll</HintPath>
<Private>True</Private>
</Reference>
<!-- Tomlyn TOML Parser -->
<Reference Include="Tomlyn">
<HintPath>packages\Tomlyn.0.19.0\lib\netstandard2.0\Tomlyn.dll</HintPath>
<Private>True</Private>
</Reference>
<!-- geometry4Sharp - 3D Geometry Library for Voxel Pathfinding -->
<Reference Include="geometry4Sharp">
<HintPath>packages\geometry4Sharp.1.0.0\lib\net48\geometry4Sharp.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<!-- Core - Main Plugin Files -->
<Compile Include="src\Core\MainPlugin.cs" />
<Compile Include="src\Core\PathClickToolPlugin.cs" />
<Compile Include="src\Core\PathInputMonitor.cs" />
<Compile Include="src\Core\PathPointRenderPlugin.cs" />
<!-- Core - Business Logic -->
<Compile Include="src\Core\ModelSplitterManager.cs" />
<Compile Include="src\Core\NavigationMapGenerator.cs" />
@ -127,24 +112,18 @@
<Compile Include="src\Core\PathDatabase.cs" />
<Compile Include="src\Core\PathAnalysisService.cs" />
<Compile Include="src\Core\PathPlanningModels.cs" />
<!-- Core - Events and Interfaces -->
<Compile Include="src\Core\IPathPlanningManagerEvents.cs" />
<Compile Include="src\Core\PathPlanningManagerEventArgs.cs" />
<!-- Core - UI State Management -->
<Compile Include="src\Core\UIStateManager.cs" />
<!-- Core - Idle Event Management -->
<Compile Include="src\Core\IdleEventManager.cs" />
<!-- Core - Document State Management -->
<Compile Include="src\Core\DocumentStateManager.cs" />
<!-- Core - Configuration Management -->
<Compile Include="src\Core\Config\SystemConfig.cs" />
<Compile Include="src\Core\Config\ConfigManager.cs" />
<!-- Commands - Command Pattern Framework (for testing) -->
<Compile Include="src\Commands\IPathPlanningCommand.cs" />
<Compile Include="src\Commands\CommandBase.cs" />
@ -152,7 +131,6 @@
<Compile Include="src\Commands\CommandManager.cs" />
<Compile Include="src\Commands\CommandExecutor.cs" />
<Compile Include="src\Commands\PathPlanningCommands.cs" />
<!-- Commands - Specific Command Implementations -->
<Compile Include="src\Commands\AutoPathPlanningCommand.cs" />
<Compile Include="src\Commands\DeletePathCommand.cs" />
@ -163,24 +141,19 @@
<Compile Include="src\Commands\GenerateCollisionReportCommand.cs" />
<Compile Include="src\Commands\VoxelGridSDFTestCommand.cs" />
<Compile Include="src\Commands\VoxelPathFindingTestCommand.cs" />
<!-- Core - Animation System -->
<Compile Include="src\Core\Animation\PathAnimationManager.cs" />
<Compile Include="src\Core\Animation\TimeLinerIntegrationManager.cs" />
<!-- Core - Collision Detection -->
<Compile Include="src\Core\Collision\ClashDetectiveIntegration.cs" />
<!-- Core - Spatial Indexing -->
<Compile Include="src\Core\Spatial\SpatialHashGrid.cs" />
<Compile Include="src\Core\Spatial\SpatialIndexManager.cs" />
<!-- Core - Properties Management -->
<Compile Include="src\Core\Properties\AttributeGrouper.cs" />
<Compile Include="src\Core\Properties\CategoryAttributeManager.cs" />
<Compile Include="src\Core\Properties\NavisworksComPropertyManager.cs" />
<Compile Include="src\Core\FloorAttributeManager.cs" />
<!-- PathPlanning - Auto Path Planning -->
<Compile Include="src\PathPlanning\GridMap.cs" />
<Compile Include="src\PathPlanning\GridMapGenerator.cs" />
@ -196,7 +169,6 @@
<Compile Include="src\PathPlanning\TimeMarkerCalculationService.cs" />
<Compile Include="src\PathPlanning\GridMapCacheKey.cs" />
<Compile Include="src\PathPlanning\GridMapCache.cs" />
<!-- PathPlanning - Voxel 3D Path Planning (Experimental) -->
<Compile Include="src\PathPlanning\VoxelCell.cs" />
<Compile Include="src\PathPlanning\VoxelGrid.cs" />
@ -204,7 +176,6 @@
<Compile Include="src\PathPlanning\VoxelPathFinder.cs" />
<Compile Include="src\PathPlanning\MeshSDFTester.cs" />
<Compile Include="src\PathPlanning\VoxelGridVisualizer.cs" />
<!-- UI - WPF -->
<Compile Include="src\UI\WPF\Views\LogisticsControlPanel.xaml.cs">
<DependentUpon>LogisticsControlPanel.xaml</DependentUpon>
@ -251,7 +222,6 @@
<Compile Include="src\UI\WPF\Views\MediaControlBar.xaml.cs">
<DependentUpon>MediaControlBar.xaml</DependentUpon>
</Compile>
<!-- UI - WPF ViewModels -->
<Compile Include="src\UI\WPF\ViewModels\ViewModelBase.cs" />
<Compile Include="src\UI\WPF\ViewModels\LogisticsControlViewModel.cs" />
@ -263,17 +233,13 @@
<Compile Include="src\UI\WPF\ViewModels\CollisionReportViewModel.cs" />
<Compile Include="src\UI\WPF\ViewModels\PathAnalysisViewModel.cs" />
<Compile Include="src\UI\WPF\ViewModels\TimeTagViewModel.cs" />
<!-- UI - WPF Collections -->
<Compile Include="src\UI\WPF\Collections\ThreadSafeObservableCollection.cs" />
<!-- UI - WPF Interfaces -->
<Compile Include="src\UI\WPF\Interfaces\IPropertyChangeNotifier.cs" />
<!-- UI - WPF Services -->
<Compile Include="src\UI\WPF\Services\BindingExpressionOptimizer.cs" />
<Compile Include="src\UI\WPF\Services\SmartDataBindingOptimizer.cs" />
<!-- UI - WPF Commands and Models -->
<Compile Include="src\UI\WPF\Commands\RelayCommand.cs" />
<Compile Include="src\UI\WPF\Commands\LayerManagementCommands.cs" />
@ -283,7 +249,6 @@
<Compile Include="src\UI\WPF\Models\LogisticsModel.cs" />
<Compile Include="src\UI\WPF\Models\PathRouteViewModel.cs" />
<Compile Include="src\UI\WPF\Models\SplitPreviewItem.cs" />
<!-- Utils -->
<Compile Include="src\Utils\BoundingBoxGeometryUtils.cs" />
<Compile Include="src\Utils\ComApiBase.cs" />
@ -300,11 +265,9 @@
<Compile Include="src\Utils\VisibilityHelper.cs" />
<Compile Include="src\Utils\ModelItemTransformHelper.cs" />
<Compile Include="src\Utils\CachedTriangle3D.cs" />
<!-- Assembly Info -->
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<!-- WPF XAML Files -->
<Page Include="src\UI\WPF\Views\LogisticsControlPanel.xaml">
@ -376,11 +339,8 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WinFX\3.0\Microsoft.WinFX.targets" Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\WinFX\3.0\Microsoft.WinFX.targets')" />
<ItemGroup>
<!-- Localization Files -->
<None Include="src\Resources\NavisworksTransport.Tian.name.txt">
@ -388,9 +348,7 @@
<Link>NavisworksTransport.Tian.name.txt</Link>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- Import NETStandard.Library targets to support .NET Standard 2.0 libraries -->
<Import Project="packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
</Project>
</Project>

63
Properties/Resources.Designer.cs generated Normal file
View File

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace NavisworksTransport.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NavisworksTransport.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

101
Properties/Resources.resx Normal file
View File

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -8,9 +8,6 @@ REM Check if MSBuild exists, try alternative paths
if not exist %MSBUILD_PATH% (
set MSBUILD_PATH="C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\MSBuild.exe"
)
if not exist %MSBUILD_PATH% (
set MSBUILD_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe"
)
if not exist %MSBUILD_PATH% (
echo MSBuild not found. Please install Visual Studio 2022 or Build Tools.
echo dotnet build is not compatible with .NET Framework WPF projects.
@ -21,7 +18,7 @@ echo Using MSBuild: %MSBUILD_PATH%
REM Build the project
echo Building project...
%MSBUILD_PATH% "NavisworksTransportPlugin.csproj" /p:Configuration=Debug /p:Platform=AnyCPU /verbosity:minimal
%MSBUILD_PATH% "NavisworksTransportPlugin.csproj" /p:Configuration=Release /p:Platform=x64 /verbosity:minimal
:end
if %ERRORLEVEL% EQU 0 (

View File

@ -3,7 +3,7 @@ set "TARGET_DIR=C:\ProgramData\Autodesk\Navisworks Manage 2026\plugins\Naviswork
if not exist "%TARGET_DIR%" mkdir "%TARGET_DIR%"
copy "bin\Debug\NavisworksTransportPlugin.dll" "%TARGET_DIR%\" >nul
if exist "bin\Debug\NavisworksTransport.Tian.name.txt" copy "bin\Debug\NavisworksTransport.Tian.name.txt" "%TARGET_DIR%\" >nul
copy "bin\x64\Release\NavisworksTransportPlugin.dll" "%TARGET_DIR%\" >nul
if exist "bin\x64\Release\NavisworksTransport.Tian.name.txt" copy "bin\x64\Release\NavisworksTransport.Tian.name.txt" "%TARGET_DIR%\" >nul
echo Plugin deployed successfully!

View File

@ -48,15 +48,31 @@
### 步骤 2配置项目属性
在解决方案资源管理器中右键点击 `NavisworksTransport.Setup``属性`
#### 注意事项
| 属性名 | 值 | 说明 |
|--------|-----|-----|
| ProductName | NavisworksTransport 2026 | 产品名称 |
| Manufacturer | YourCompany | 制造商 |
| Version | 1.0.0 | 版本号 |
| Title | NavisworksTransport Setup | 安装程序标题 |
| Subject | Navisworks 2026 物流路径规划插件 | 主题 |
由于Visual Studio和Installer Projects插件版本差异某些图形界面设置方法可能不可用或显示不完整。因此推荐使用以下最可靠的配置方法
#### 手动编辑vdproj文件唯一可靠方法
直接编辑项目文件是最可靠的配置方式适用于所有Visual Studio版本
1. 在解决方案资源管理器中选中 `NavisworksTransport.Setup` 项目
2. 点击菜单栏 `项目``卸载项目`
3. 再次右键点击项目 → `编辑 NavisworksTransport.Setup.vdproj`
4. 在打开的文件中找到 `"Product"` 节点(通常在文件末尾附近)
5. 直接修改以下属性值:
```ini
"ProductName" = "8:NavisworksTransport 2026"
"Manufacturer" = "8:YourCompany"
"ProductVersion" = "8:1.0.0"
"Title" = "8:NavisworksTransport Setup"
"Subject" = "8:Navisworks 2026 物流路径规划插件"
```
#### 高级设置说明
如需配置构建事件、系统必备项等高级设置请参考Visual Studio Installer Projects的官方文档或根据实际需要在vdproj文件中查找并修改对应节点的属性值。
> **升级代码**: 首次安装后会生成 `UpgradeCode`**升级时保持不变**,版本号变更会触发自动升级
@ -81,7 +97,7 @@
- 项目:`NavisworksTransportPlugin`
- 选择配置:`Release`
- 平台:`x64`
- 平台:`x64`**重要:必须与项目平台一致,否则会出现平台不兼容错误**
- 输出类型:选择 `Primary output`
- 点击 `确定`
@ -109,14 +125,62 @@
- `Condition`: (留空,表示始终安装)
- `Register`: NoRegister插件无需注册
### 方案 B通过文件视图
#### 步骤 6排除不必要的依赖DLL
另一种方法是使用 `View``文件` 直接操作:
**为什么需要排除?**
安装项目
├── Application Folder/
│ ├── Primary output from NavisworksTransportPlugin (Active)
│ └── 额外配置文件(如果有)
- 系统DLL如System.Net.Http.dll、System.IO.Compression.dll等由Windows系统提供
- Navisworks API DLL如Autodesk.Navisworks.*.dll由Navisworks应用程序提供
- 这些DLL不应包含在安装包中避免版本冲突和安装包过大
**如何识别需要排除的DLL**
- **系统DLL**:通常以`System.`开头如System.Net.Http.dll、System.IO.Compression.dll
- **Navisworks API DLL**:以`Autodesk.Navisworks.`开头
- **其他应用程序DLL**由其他已安装软件提供的DLL
**排除方法:**
1. **通过文件系统编辑器排除**
- 在文件系统编辑器中,展开 `Application Folder``Primary output from NavisworksTransportPlugin (Active)`
- 找到需要排除的DLL如System.Net.Http.dll
- 右键点击该DLL → `属性窗口`
- 将 `Exclude` 属性设置为 `TRUE`
2. **通过直接编辑项目文件排除**(高级方法)
- 在解决方案资源管理器中右键点击setup项目 → `卸载项目`
- 再次右键点击 → `编辑 NavisworksTransport.Setup.vdproj`
- 找到需要排除的DLL节点通常包含"AssemblyAsmDisplayName"、"Name"和"SourcePath"
- 将 `"Exclude" = "11:FALSE"` 修改为 `"Exclude" = "11:TRUE"`
- 保存文件,右键点击项目 → `重新加载项目`
**需要排除的常见DLL**
- 系统DLL
- System.Net.Http.dll
- System.IO.Compression.dll
- System.IO.Compression.FileSystem.dll
- System.Diagnostics.Tracing.dll
- System.Core.dll
- System.Windows.Forms.dll
- System.Drawing.dll
- System.Data.dll
- System.xml.dll
- Navisworks API DLL
- Autodesk.Navisworks.Api.dll
- Autodesk.Navisworks.ComApi.dll
- Autodesk.Navisworks.Interop.ComApi.dll
- Autodesk.Navisworks.Controls.dll
- Autodesk.Navisworks.Clash.dll
- Autodesk.Navisworks.Timeliner.dll
**验证排除结果:**
1. 重新构建setup项目
2. 检查构建输出确认排除的DLL不再被包含
3. 安装后检查目标目录确认排除的DLL没有被安装
4. 启动Navisworks验证插件正常运行依赖项由系统或Navisworks提供
---
@ -132,18 +196,23 @@
1. 在 `文件系统` 视图中
2. 点击左侧 `Application Folder`
3. 在属性窗口中设置 `DefaultLocation`
3. 将AlwaysCreate属性设置为`TRUE`
4. 在属性窗口中设置 `DefaultLocation`
DefaultLocation = [ProgramDataFolder]\Autodesk\Navisworks Manage 2026\plugins\NavisworksTransportPlugin
DefaultLocation = [CommonAppDataFolder]\Autodesk\Navisworks Manage 2026\plugins\NavisworksTransportPlugin
### 目录结构说明
| 目录 | 说明 | 环境变量 |
|------|------|----------|
| [ProgramDataFolder] | 公共应用数据 | %ProgramData% |
| [ProgramFilesFolder] | 程序文件目录 | %ProgramFiles% |
| [AppDataFolder] | 用户应用数据 | %AppData% |
| [CommonAppDataFolder] | 公共应用数据 | %AllUsersProfile% |
| 目录 | 说明 | 环境变量 | 正确的Windows Installer属性 |
|------|------|----------|----------------------------|
| 公共应用数据 | %ProgramData% | C:\ProgramData\ | [CommonAppDataFolder] |
| 程序文件目录 | %ProgramFiles% | C:\Program Files\ | [ProgramFilesFolder] |
| 用户应用数据 | %AppData% | C:\Users\用户名\AppData\Roaming\ | [AppDataFolder] |
| 本地用户应用数据 | %LocalAppData% | C:\Users\用户名\AppData\Local\ | [LocalAppDataFolder] |
| 桌面文件夹 | 桌面 | C:\Users\用户名\Desktop\ | [DesktopFolder] |
| 开始菜单 | 开始菜单 | C:\ProgramData\Microsoft\Windows\Start Menu\ | [StartMenuFolder] |
> **注意**: Windows Installer Projects 扩展使用 `[CommonAppDataFolder]` 来表示系统的 `%ProgramData%` 目录,而不是 `[ProgramDataFolder]`
---
@ -172,45 +241,12 @@ DefaultLocation = [ProgramDataFolder]\Autodesk\Navisworks Manage 2026\plugins\Na
2. 点击 `系统必备...` 按钮
3. 在系统必备组件列表中:
- ✅ 勾选 `Microsoft .NET Framework 4.8 (x86 and x64)`
- ✅ 勾选 `Windows Installer 4.5`(通常已包含在系统中)
4. 设置:
- ✅ `下载系统必备组件从以下位置`: 组件供应商的网站
- 或 `将系统必备组件组件下载到同一应用程序文件夹`
---
## 第七部分:配置构建事件
### 预构建事件
在安装项目属性中添加:
#### 清理旧的构建文件
```batch
if exist "$(ProjectDir)bin\Release\*.msi" del /q "$(ProjectDir)bin\Release\*.msi"
if exist "$(ProjectDir)bin\Release\*.cab" del /q "$(ProjectDir)bin\Release\*.cab"
```
### 后构建事件
#### 自动复制MSI到输出目录
```batch
xcopy "$(ProjectDir)bin\Release\NavisworksTransport.Setup.msi" "$(SolutionDir)bin\Release\" /Y
```
### 构建事件配置方法
1. 右键点击安装项目 → `属性`
2. 在属性窗口中设置:
- **PreBuildEvent**: 输入预构建命令
- **PostBuildEvent**: 输入后构建命令
- **PostBuildEventCondition**: `On successful build``Always`
---
## 第八部分:构建和测试
## 第七部分:构建和测试
### 构建 Release 版本
@ -234,9 +270,43 @@ msbuild NavisworksTransport.sln /p:Configuration=Release /p:Platform=x64 /t:Navi
### 构建输出
成功构建后,在以下位置找到MSI文件:
成功构建后,在以下位置找到安装文件:
解决方案目录\bin\Release\NavisworksTransport.Setup.msi
- 解决方案目录\bin\Release\NavisworksTransport.Setup.msi
- 解决方案目录\bin\Release\setup.exe
### setup.exe与.msi文件的区别
Visual Studio Installer Projects 会生成两个安装文件,它们各有不同用途:
#### setup.exe引导程序/启动器)
- **主要功能**:检查并安装系统必备组件(如特定版本的.NET Framework
- **使用场景**
- 目标系统可能缺少必要的依赖项
- 需要自动处理依赖安装的情况
- 提供更友好的安装体验
- **工作机制**
1. 检查系统是否满足所有必备条件
2. 如果缺少依赖,会自动下载并安装
3. 然后启动.msi安装包完成实际安装
#### .msi文件Windows Installer数据包
- **主要功能**:包含实际的安装内容和配置
- **使用场景**
- 目标系统已经满足所有依赖条件
- 需要通过命令行进行静默安装
- 只需要实际安装内容,不需要依赖检查
- **工作机制**
- 直接通过Windows Installer服务安装
- 可以使用msiexec命令进行高级安装配置
- 不具备检查和安装系统必备组件的能力
#### 分发建议
- **完整分发**同时提供setup.exe和.msi文件让用户根据需求选择
- **简化分发**如果可以确保所有目标系统都已安装必要的依赖项如Navisworks 2026环境已包含所需的.NET Framework版本可以只提供.msi文件
### 测试安装
@ -389,7 +459,18 @@ pause
2. 在安装项目中明确指定.NET 4.8
3. 在系统必备组件中勾选.NET 4.8
### Q5: 权限不足错误
### Q5: 平台不兼容错误
**现象**: 构建时出现 "File 'xxx.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'" 错误
**解决**:
1. 在解决方案资源管理器中右键点击 `解决方案 'NavisworksTransport'``配置管理器`
2. 将 `NavisworksTransport.Setup` 项目的平台设置为 `x64`
3. 确保所有项目的平台一致都是x64
4. 在添加项目输出时,确保选择的平台是 `x64`
### Q6: 权限不足错误
**现象**: 安装时提示"拒绝访问"
@ -438,6 +519,27 @@ NavisworksTransport/
| Release | 发布版本 | 优化,体积小 |
| CI/CD | 自动化构建 | 静默构建生成MSI |
### 4. 依赖管理最佳实践
**排除不必要的DLL**
- 始终排除**系统DLL**如System.*.dll
- 始终排除**Navisworks API DLL**Autodesk.Navisworks.*.dll
- 排除**其他应用程序提供的DLL**如第三方软件的共享DLL
**仅包含必要的文件:**
- 自定义应用程序DLLNavisworksTransportPlugin.dll
- 第三方库DLL如SQLite.NET.dll等
- 配置文件config.json等
- 资源文件(图标、文档等)
**定期检查:**
- 每次构建后检查输出目录的文件列表
- 确保没有包含不需要的DLL
- 检查新添加的依赖项,确认是否需要排除
### 4. 测试清单
安装MSI前必须测试
@ -515,5 +617,5 @@ NavisworksTransport.Setup/
---
**文档版本**: 1.0
**最后更新**: 2025-11-17
**最后更新**: 2025-11-18
**维护者**: NavisworksTransport 开发团队