Skip to content

Commit de4f53c

Browse files
committed
release
1 parent e91305e commit de4f53c

File tree

12 files changed

+184
-32
lines changed

12 files changed

+184
-32
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.vs/
22
obj/
33
bin/
4-
temp/
4+
temp/
5+
Setup/BearBuildTool.exe
6+
Setup/BearBuildTool-1.bin

BearBuildTool.cs

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.IO;
77
using System.Linq;
88
using System.Text;
9+
using System.Windows.Forms;
910
/// <summary>
1011
/// test 2
1112
/// </summary>
@@ -36,23 +37,42 @@ static void Help()
3637
}
3738
static void Initialize()
3839
{
39-
Config.Global.IntermediatePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", Config.Global.IntermediatePath);
40+
4041
Config.Global.LoadConfig();
42+
if(String.IsNullOrEmpty( Config.Global.BasePath)||!Directory.Exists(Config.Global.BasePath))
43+
{
44+
using (var fbd = new FolderBrowserDialog())
45+
{
46+
DialogResult result = fbd.ShowDialog();
47+
48+
if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath))
49+
{
50+
Config.Global.BasePath = fbd.SelectedPath;
51+
Config.Global.SaveConfig();
52+
}
53+
else
54+
{
55+
Application.Exit();
56+
}
57+
}
58+
}
59+
60+
Config.Global.IntermediatePath = Path.Combine(Config.Global.BasePath, Config.Global.IntermediatePath);
4161
if (!Directory.Exists(Config.Global.IntermediatePath))
4262
{
4363
Directory.CreateDirectory(Config.Global.IntermediatePath);
4464
}
4565
Config.Global.IntermediatePath = Path.GetFullPath(Config.Global.IntermediatePath);
4666

47-
Config.Global.BinariesPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", Config.Global.BinariesPath);
67+
Config.Global.BinariesPath = Path.Combine(Config.Global.BasePath, Config.Global.BinariesPath);
4868

4969
if (!Directory.Exists(Config.Global.BinariesPath))
5070
{
5171
Directory.CreateDirectory(Config.Global.BinariesPath);
5272
}
5373
Config.Global.BinariesPath = Path.GetFullPath(Config.Global.BinariesPath);
5474

55-
Config.Global.ProjectsPath = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", Config.Global.ProjectsPath));
75+
Config.Global.ProjectsPath = Path.GetFullPath(Path.Combine(Config.Global.BasePath, Config.Global.ProjectsPath));
5676

5777
Config.Global.ProjectsCSFile = new Dictionary<string, string>();
5878

@@ -246,16 +266,16 @@ static void CallAction(string arg,string[] args,int i)
246266
if (arg == "-cleanall")
247267
{
248268
Console.WriteLine("Полная чистка");
249-
Config.Global.IntermediatePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", Config.Global.IntermediatePath);
269+
Config.Global.IntermediatePath = Path.Combine(Config.Global.BasePath, Config.Global.IntermediatePath);
250270

251271
if (Directory.Exists(Config.Global.IntermediatePath))
252272
{
253273
Config.Global.IntermediatePath = Path.GetFullPath(Config.Global.IntermediatePath);
254274
Directory.Delete(Config.Global.IntermediatePath);
255275
}
256-
if (FileSystem.ExistsFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "Bear.sln")))
276+
if (FileSystem.ExistsFile(Path.Combine(Config.Global.BasePath, "Bear.sln")))
257277
{
258-
File.Delete(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "Bear.sln"));
278+
File.Delete(Path.Combine(Config.Global.BasePath, "Bear.sln"));
259279
}
260280
System.Environment.Exit(0);
261281
}

BearBuildTool.csproj

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,28 @@
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
77
<ProjectGuid>{E4667E41-E4B5-44EA-8222-A20E3CF4028A}</ProjectGuid>
8-
<OutputType>Exe</OutputType>
8+
<OutputType>WinExe</OutputType>
99
<RootNamespace>BearBuildTool</RootNamespace>
1010
<AssemblyName>BearBuildTool</AssemblyName>
1111
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1212
<FileAlignment>512</FileAlignment>
1313
<Deterministic>true</Deterministic>
1414
<TargetFrameworkProfile />
15+
<PublishUrl>publish\</PublishUrl>
16+
<Install>true</Install>
17+
<InstallFrom>Disk</InstallFrom>
18+
<UpdateEnabled>false</UpdateEnabled>
19+
<UpdateMode>Foreground</UpdateMode>
20+
<UpdateInterval>7</UpdateInterval>
21+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
22+
<UpdatePeriodically>false</UpdatePeriodically>
23+
<UpdateRequired>false</UpdateRequired>
24+
<MapFileExtensions>true</MapFileExtensions>
25+
<ApplicationRevision>0</ApplicationRevision>
26+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
27+
<IsWebBootstrapper>false</IsWebBootstrapper>
28+
<UseApplicationTrust>false</UseApplicationTrust>
29+
<BootstrapperEnabled>true</BootstrapperEnabled>
1530
</PropertyGroup>
1631
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1732
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -38,6 +53,9 @@
3853
<PropertyGroup>
3954
<StartupObject />
4055
</PropertyGroup>
56+
<PropertyGroup>
57+
<ApplicationIcon>ico.ico</ApplicationIcon>
58+
</PropertyGroup>
4159
<ItemGroup>
4260
<Reference Include="Microsoft.VisualStudio.Setup.Configuration.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
4361
<HintPath>packages\Microsoft.VisualStudio.Setup.Configuration.Interop.1.16.30\lib\net35\Microsoft.VisualStudio.Setup.Configuration.Interop.dll</HintPath>
@@ -148,6 +166,15 @@
148166
<DependentUpon>VSProjectManager.cs</DependentUpon>
149167
</EmbeddedResource>
150168
</ItemGroup>
151-
<ItemGroup />
169+
<ItemGroup>
170+
<Content Include="ico.ico" />
171+
</ItemGroup>
172+
<ItemGroup>
173+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
174+
<Visible>False</Visible>
175+
<ProductName>.NET Framework 3.5 SP1</ProductName>
176+
<Install>false</Install>
177+
</BootstrapperPackage>
178+
</ItemGroup>
152179
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
153180
</Project>

BearBuildTool.csproj.user

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,14 @@
1111
<StartAction>Project</StartAction>
1212
<StartArguments>testLinux Debug Linux</StartArguments>
1313
</PropertyGroup>
14+
<PropertyGroup>
15+
<PublishUrlHistory>publish\</PublishUrlHistory>
16+
<InstallUrlHistory />
17+
<SupportUrlHistory />
18+
<UpdateUrlHistory />
19+
<BootstrapperUrlHistory />
20+
<ErrorReportUrlHistory />
21+
<FallbackCulture>ru-RU</FallbackCulture>
22+
<VerifyUploadedFiles>false</VerifyUploadedFiles>
23+
</PropertyGroup>
1424
</Project>

Config/Global.cs

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public enum Platform
2525
}
2626
public class Global
2727
{
28+
public static string BasePath = null;
2829
public static string ProjectsPath = "projects";
2930
public static string IntermediatePath = "intermediate";
3031
public static string BinariesPath = "binaries";
@@ -123,43 +124,58 @@ public static bool SetConfigure(string str)
123124
}
124125
public static string Windows10SDK = String.Empty;
125126
public static bool Windows10SDKUsing = true;
126-
private static int VersionConfig = 2;
127+
private static int VersionConfig = 3;
127128
public static bool IsWindows=true;
128129

129130

130131
public static void SaveConfig()
131132
{
132-
string name = Path.Combine(IntermediatePath, "config.bin");
133+
try
134+
{ File.Delete("config.bin"); }
135+
catch { }
133136
try
134137
{
135-
BinaryWriter writer = new BinaryWriter(File.Open(name, FileMode.OpenOrCreate));
138+
BinaryWriter writer = new BinaryWriter(File.Open("config.bin", FileMode.Create));
136139
{
137140
writer.Write(VersionConfig);
138141
writer.Write(Windows10SDK);
139142
writer.Write(Windows10SDKUsing);
140143
writer.Write(MinGWPath);
144+
writer.Write(BasePath);
141145
}
146+
writer.Close();
142147
}
143148
catch { }
144149
}
145150
public static void LoadConfig()
146151
{
147-
string name = Path.Combine(IntermediatePath, "config.bin");
148152
try
149153
{
150-
BinaryReader reader = new BinaryReader(File.Open(name, FileMode.Open));
151-
int version = reader.ReadInt32();
152-
if(version == 1)
153-
{
154-
Windows10SDK = reader.ReadString();
155-
Windows10SDKUsing = reader.ReadBoolean();
156-
}
157-
else if (VersionConfig == version)
154+
BinaryReader reader = new BinaryReader(File.Open("config.bin", FileMode.Open,FileAccess.Read));
155+
try
158156
{
159-
Windows10SDK = reader.ReadString();
160-
Windows10SDKUsing = reader.ReadBoolean();
161-
MinGWPath = reader.ReadString();
157+
int version = reader.ReadInt32();
158+
if (version == 1)
159+
{
160+
Windows10SDK = reader.ReadString();
161+
Windows10SDKUsing = reader.ReadBoolean();
162+
}
163+
else if (version == 2)
164+
{
165+
Windows10SDK = reader.ReadString();
166+
Windows10SDKUsing = reader.ReadBoolean();
167+
MinGWPath = reader.ReadString();
168+
}
169+
else if (version == VersionConfig)
170+
{
171+
Windows10SDK = reader.ReadString();
172+
Windows10SDKUsing = reader.ReadBoolean();
173+
MinGWPath = reader.ReadString();
174+
BasePath = reader.ReadString();
175+
}
162176
}
177+
catch { }
178+
reader.Close();
163179
}
164180
catch { }
165181
}

Projects/ExecutableReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private static void Read2()
5454
string namedll = "executabls";
5555
namedll = namedll + "_" + Config.Global.Platform.ToString() + "_" + Config.Global.Configure.ToString();
5656
namedll += ".dll";
57-
57+
if (ListFileProjects.Length == 0) return;
5858
Assembly asm = Compiler.CompilerAndLoad(ListFileProjects, Path.Combine(Config.Global.IntermediatePath, namedll));
5959

6060
foreach (string file in ListFileProjects)

Projects/ProjectsReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private static void Read2()
5252
Config.Global.ProjectsMap[Config.Global.Platform] = new Dictionary<Config.Configure, Dictionary<string, Project>>();
5353
if (!Config.Global.ProjectsMap[Config.Global.Platform].ContainsKey(Config.Global.Configure))
5454
Config.Global.ProjectsMap[Config.Global.Platform][Config.Global.Configure] = new Dictionary<string, Project>();
55-
55+
if (!Directory.Exists(Config.Global.ProjectsPath)) try { Directory.CreateDirectory(Config.Global.ProjectsPath); } catch { }
5656
if(ListFileProjects == null) ListFileProjects = Directory.GetFiles(Config.Global.ProjectsPath, "*.project.cs", SearchOption.AllDirectories);
5757

5858
if (ListFileProjects == null || ListFileProjects.Length == 0) return;

Setup/Setup.iss

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
; Script generated by the Inno Setup Script Wizard.
2+
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3+
4+
#define MyAppName "BearBuildTool."
5+
#define MyAppVersion "1.0.100"
6+
#define MyAppPublisher "TheBearProject, Inc."
7+
#define MyAppURL "https://twitter.com/isobolevskiy/"
8+
#define MyAppExeName "BearBuildTool.exe"
9+
10+
[Setup]
11+
; NOTE: The value of AppId uniquely identifies this application.
12+
; Do not use the same AppId value in installers for other applications.
13+
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
14+
AppId={{AF708729-7E28-442D-8CBF-2152F47C871C}
15+
AppName={#MyAppName}
16+
AppVersion={#MyAppVersion}
17+
;AppVerName={#MyAppName} {#MyAppVersion}
18+
AppPublisher={#MyAppPublisher}
19+
AppPublisherURL={#MyAppURL}
20+
AppSupportURL={#MyAppURL}
21+
AppUpdatesURL={#MyAppURL}
22+
DefaultDirName={autopf}\{#MyAppName}
23+
DefaultGroupName={#MyAppName}
24+
OutputDir=.
25+
OutputBaseFilename=BearBuildTool
26+
SetupIconFile=..\ico.ico
27+
SolidCompression=yes
28+
Compression=lzma2/ultra64
29+
LZMAUseSeparateProcess=yes
30+
LZMADictionarySize=1048576
31+
LZMANumFastBytes=273
32+
DiskSpanning=true
33+
DiskSliceSize=1073741824
34+
35+
[Languages]
36+
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
37+
38+
[Tasks]
39+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags:
40+
41+
[Files]
42+
Source: "..\bin\release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs ;
43+
44+
45+
[Icons]
46+
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
47+
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
48+
49+
[Run]
50+
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
51+

UI/MainForm.Designer.cs

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

0 commit comments

Comments
 (0)