Skip to content

Commit 3d50b55

Browse files
ForAutoCAD2021, Support NET48
1 parent ead598f commit 3d50b55

File tree

83 files changed

+249
-7877
lines changed

Some content is hidden

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

83 files changed

+249
-7877
lines changed

ArxLocatorTestCase/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
5+
</startup>
6+
</configuration>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{376FDBA4-5296-41F1-B715-B87621840318}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>ArxLocatorTestCase</RootNamespace>
10+
<AssemblyName>ArxLocatorTestCase</AssemblyName>
11+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="System" />
37+
<Reference Include="System.Core" />
38+
<Reference Include="System.Windows.Forms" />
39+
<Reference Include="System.Xml.Linq" />
40+
<Reference Include="System.Data.DataSetExtensions" />
41+
<Reference Include="Microsoft.CSharp" />
42+
<Reference Include="System.Data" />
43+
<Reference Include="System.Net.Http" />
44+
<Reference Include="System.Xml" />
45+
<Reference Include="XmlConfigurator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=48165b3e135e2831, processorArchitecture=MSIL">
46+
<SpecificVersion>False</SpecificVersion>
47+
<HintPath>..\AutoCADNetWizardsInstaller\Output\XmlConfigurator.dll</HintPath>
48+
</Reference>
49+
</ItemGroup>
50+
<ItemGroup>
51+
<Compile Include="Program.cs" />
52+
<Compile Include="Properties\AssemblyInfo.cs" />
53+
</ItemGroup>
54+
<ItemGroup>
55+
<None Include="App.config" />
56+
</ItemGroup>
57+
<ItemGroup>
58+
<ProjectReference Include="..\ArxLocatorWizard2010\ArxLocatorWizard.csproj">
59+
<Project>{3B69A4AD-360E-49F9-9A79-3FD35D1D15D2}</Project>
60+
<Name>ArxLocatorWizard</Name>
61+
</ProjectReference>
62+
</ItemGroup>
63+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
64+
</Project>

ArxLocatorTestCase/Program.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using Microsoft.Win32;
2+
using ObjectARXLocatorWizard;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
9+
namespace ArxLocatorTestCase
10+
{
11+
class Program
12+
{
13+
static void Main(string[] args)
14+
{
15+
16+
//ObjectARXLocatorForm form = new ObjectARXLocatorForm();
17+
//form.Show();
18+
19+
RegistryKey ukey = Registry.CurrentUser;
20+
RegistryKey acad = ukey.OpenSubKey("SOFTWARE\\Autodesk\\AutoCAD");
21+
string curver = acad.GetValue("CurVer") as string;
22+
RegistryKey version = ukey.OpenSubKey("SOFTWARE\\Autodesk\\AutoCAD\\" + curver);
23+
string key = version.GetValue("CurVer") as string;
24+
RegistryKey acad2 = ukey.OpenSubKey("SOFTWARE\\Autodesk\\AutoCAD\\" + curver + "\\" + key);
25+
string acadpath = acad2.GetValue("SupportFolder") as string;
26+
int pos = acadpath.IndexOf("\\Support");
27+
acadpath = acadpath.Substring(0, pos);
28+
}
29+
}
30+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("ArxLocatorTestCase")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("ArxLocatorTestCase")]
13+
[assembly: AssemblyCopyright("Copyright © 2020")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("376fdba4-5296-41f1-b715-b87621840318")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

ArxLocatorWizard2010/ArxLocatorWizard.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
1111
<RootNamespace>ObjectARXLocatorWizard</RootNamespace>
1212
<AssemblyName>ObjectARXLocatorWizard</AssemblyName>
13-
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
13+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1414
<FileAlignment>512</FileAlignment>
1515
<SignAssembly>true</SignAssembly>
1616
<AssemblyOriginatorKeyFile>ObjectARXLocatorWizard.snk</AssemblyOriginatorKeyFile>

ArxLocatorWizard2010/ObjectARXLocatorForm.Designer.cs

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ArxLocatorWizard2010/ObjectARXLocatorForm.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public ObjectARXLocatorForm()
5050

5151
}
5252

53-
private void searchsdk_Click(object sender, EventArgs e)
53+
private void Searchsdk_Click(object sender, EventArgs e)
5454
{
5555
if (this.folderBrowserDialog.ShowDialog() == DialogResult.OK)
5656
{
@@ -66,7 +66,7 @@ private void searchsdk_Click(object sender, EventArgs e)
6666
}
6767
}
6868

69-
private void sdkpath_TextChanged(object sender, EventArgs e)
69+
private void Sdkpath_TextChanged(object sender, EventArgs e)
7070
{
7171
bool exists = System.IO.File.Exists(this.sdkpath.Text.Trim() + "\\AcMgd.dll");
7272
if (!exists)
@@ -87,7 +87,7 @@ private void sdkpath_TextChanged(object sender, EventArgs e)
8787
// && System.IO.Directory.Exists(this.sdkpath.Text.Trim()));
8888
}
8989

90-
private void searchacad_Click(object sender, EventArgs e)
90+
private void Searchacad_Click(object sender, EventArgs e)
9191
{
9292
if (this.folderBrowserDialog.ShowDialog() == DialogResult.OK)
9393
{
@@ -102,7 +102,7 @@ private void searchacad_Click(object sender, EventArgs e)
102102
}
103103
}
104104

105-
private void acadpath_TextChanged(object sender, EventArgs e)
105+
private void Acadpath_TextChanged(object sender, EventArgs e)
106106
{
107107
mConfig.SetValueAt(".//Autodesk/Wizards/ObjectARX/AcadLocation", this.acadpath.Text.Trim());
108108
mConfig.Save();
@@ -119,26 +119,26 @@ private void acadpath_TextChanged(object sender, EventArgs e)
119119

120120
}
121121

122-
private void aboutbox_Click(object sender, EventArgs e)
122+
private void Aboutbox_Click(object sender, EventArgs e)
123123
{
124124
AboutBox dlg = new AboutBox();
125125
dlg.ShowDialog();
126126
dlg.Dispose();
127127
}
128128

129-
private void interop0_CheckedChanged(object sender, EventArgs e)
129+
private void Interop0_CheckedChanged(object sender, EventArgs e)
130130
{
131131
if (!interop0.Checked)
132132
interop1.Checked = false;
133133
}
134134

135-
private void interop1_CheckedChanged(object sender, EventArgs e)
135+
private void Interop1_CheckedChanged(object sender, EventArgs e)
136136
{
137137
if (interop1.Checked)
138138
interop0.Checked = true;
139139
}
140140

141-
private void folderBrowserDialog1_HelpRequest(object sender, EventArgs e)
141+
private void FolderBrowserDialog1_HelpRequest(object sender, EventArgs e)
142142
{
143143

144144
}
@@ -378,7 +378,7 @@ private void ClearAllCheckBoxes(Control parent)
378378
}
379379
#endregion
380380

381-
private void cbRunAs_SelectedIndexChanged(object sender, EventArgs e)
381+
private void CbRunAs_SelectedIndexChanged(object sender, EventArgs e)
382382
{
383383
ProductChanged();
384384
}

ArxLocatorWizard2010/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
[assembly: AssemblyTitle("AutoCAD .Net Wizards")]
3131
[assembly: AssemblyDescription("by Cyrille Fauvel - Autodesk Developer Network")]
3232
[assembly: AssemblyConfiguration("")]
33-
[assembly: AssemblyCompany("Autodesk, Inc.")]
33+
[assembly: AssemblyCompany("Autodesk")]
3434
[assembly: AssemblyProduct("AutoCAD .Net Wizards")]
3535
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. All rights reserved.")]
3636
[assembly: AssemblyTrademark("")]

ArxLocatorWizard2010/Wizard.cs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ public class Wizard : IWizard
123123
/// <param name="customParams">The custom parameters with which to perform parameter replacement in the project.</param>
124124
void IWizard.RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
125125
{
126+
#if DEBUG
127+
System.Diagnostics.Debugger.Launch();
128+
#endif
126129
System.Reflection.Assembly ass = System.Reflection.Assembly.GetExecutingAssembly(); // GetEntryAssembly()
127130
AddInCompany =((AssemblyCompanyAttribute)Attribute.GetCustomAttribute (ass, typeof(AssemblyCompanyAttribute), false)).Company ;
128131
AssemblyTitleAttribute titleAttr = ass.GetCustomAttributes(typeof(System.Reflection.AssemblyTitleAttribute), false)[0] as AssemblyTitleAttribute;
@@ -639,24 +642,21 @@ string FindAutoCAD()
639642
string acadpath;
640643
try
641644
{
645+
642646
RegistryKey ukey = Registry.CurrentUser;
643647
RegistryKey acad = ukey.OpenSubKey("SOFTWARE\\Autodesk\\AutoCAD");
644648
string curver = acad.GetValue("CurVer") as string;
645649
RegistryKey version = ukey.OpenSubKey("SOFTWARE\\Autodesk\\AutoCAD\\" + curver);
646650
string key = version.GetValue("CurVer") as string;
647-
//- We cannot read HKEY_LOCAL_MACHINE on Vista
648-
//RegistryKey lkey = Registry.LocalMachine;
649-
//RegistryKey acad2 = lkey.OpenSubKey("SOFTWARE\\Autodesk\\AutoCAD\\" + curver + "\\" + key);
650-
//string acadpath = acad2.GetValue("AcadLocation") as string;
651651
RegistryKey acad2 = ukey.OpenSubKey("SOFTWARE\\Autodesk\\AutoCAD\\" + curver + "\\" + key);
652-
acadpath = acad2.GetValue("NFWFile") as string;
653-
int pos = acadpath.IndexOf("\\Help");
652+
acadpath = acad2.GetValue("SupportFolder") as string;
653+
int pos = acadpath.IndexOf("\\Support");
654654
acadpath = acadpath.Substring(0, pos);
655655
}
656656
catch
657657
{
658-
//*If AutoCAD 2017 is not found, we will default to ACAD 2017*//
659-
acadpath = "C:\\Program Files\\Autodesk\\AutoCAD 2017";
658+
//*If AutoCAD is not found we will return default location*//
659+
acadpath = "C:\\Program Files\\Autodesk\\AutoCAD 2021";
660660
}
661661
return (acadpath);
662662
}
@@ -734,12 +734,5 @@ public string Distinguish64or32System()
734734

735735
}
736736

737-
//public class Start
738-
//{
739-
// public static void Main()
740-
// {
741-
// ObjectARXLocatorForm form = new ObjectARXLocatorForm();
742-
// form.Show();
743-
// }
744-
//}
737+
745738
}

0 commit comments

Comments
 (0)