Skip to content

Commit 51ca5b6

Browse files
committed
Pyinstaller Helper 1.4
1 parent e3c4d8d commit 51ca5b6

15 files changed

Lines changed: 8178 additions & 12 deletions

CompileForm.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,14 @@ private void DoTheDeed(string tempdir)
8282
p.StartInfo.CreateNoWindow = true;
8383
p.OutputDataReceived += OnInputRecv;
8484
p.ErrorDataReceived += OnInputRecv;
85-
p.Start();
85+
try
86+
{
87+
p.Start();
88+
} catch
89+
{
90+
MessageBox.Show("You do not appear to have pyinstaller installed. Please go to Options -> Pyinstaller to fix this.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
91+
return;
92+
}
8693
p.BeginOutputReadLine();
8794
p.BeginErrorReadLine();
8895

Form1.Designer.cs

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

Form1.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,5 +316,10 @@ private void Form1_FormClosing(object sender, FormClosingEventArgs e)
316316
}
317317
}
318318
}
319+
320+
private void pyinstallerToolStripMenuItem_Click(object sender, EventArgs e)
321+
{
322+
new PyinstallerSetting().ShowDialog(this);
323+
}
319324
}
320325
}

Program.cs

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,41 @@ public static string PadVersionRight(string inv)
6565
return inv;
6666
}
6767
}
68-
68+
public static bool ExistsOnPath(string fileName)
69+
{
70+
return GetFullPath(fileName) != null;
71+
}
72+
73+
public static string GetFullPath(string fileName)
74+
{
75+
if (File.Exists(fileName))
76+
return Path.GetFullPath(fileName);
77+
78+
var values = Environment.GetEnvironmentVariable("PATH");
79+
foreach (var path in values.Split(';'))
80+
{
81+
var fullPath = Path.Combine(path, fileName);
82+
if (File.Exists(fullPath))
83+
return fullPath;
84+
}
85+
return null;
86+
}
87+
public static DialogResult RunGUICommand(string fullcommand,int expectedlines,string title,Form parent)
88+
{
89+
VerboseCommandExecutorForm vcf = new VerboseCommandExecutorForm();
90+
string[] splcommand = CLISplit.SplitCommandLine(fullcommand).ToArray();
91+
string cmdhead = splcommand[0];
92+
string[] finall = new string[splcommand.Length - 1];
93+
splcommand.ToList().CopyTo(1,finall,0, splcommand.Length-2);
94+
string cmdargs = string.Join(" ", finall);
95+
vcf.EFile = cmdhead;
96+
vcf.EArgs = cmdargs;
97+
vcf.Title = title;
98+
vcf.ExpectedLines = expectedlines;
99+
return vcf.ShowDialog(parent);
100+
101+
}
102+
69103
}
70104
public class PyinstallerHelperProject
71105
{

Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.1.0.0")]
36-
[assembly: AssemblyFileVersion("1.1.0.0")]
35+
[assembly: AssemblyVersion("1.4.0.0")]
36+
[assembly: AssemblyFileVersion("1.4.0.0")]

PyinstallerHelper.csproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,18 @@
6363
</Compile>
6464
<Compile Include="Program.cs" />
6565
<Compile Include="Properties\AssemblyInfo.cs" />
66+
<Compile Include="PyinstallerSetting.cs">
67+
<SubType>Form</SubType>
68+
</Compile>
69+
<Compile Include="PyinstallerSetting.Designer.cs">
70+
<DependentUpon>PyinstallerSetting.cs</DependentUpon>
71+
</Compile>
72+
<Compile Include="VerboseCommandExecutorForm.cs">
73+
<SubType>Form</SubType>
74+
</Compile>
75+
<Compile Include="VerboseCommandExecutorForm.Designer.cs">
76+
<DependentUpon>VerboseCommandExecutorForm.cs</DependentUpon>
77+
</Compile>
6678
<EmbeddedResource Include="CompileForm.resx">
6779
<DependentUpon>CompileForm.cs</DependentUpon>
6880
</EmbeddedResource>
@@ -78,6 +90,12 @@
7890
<AutoGen>True</AutoGen>
7991
<DependentUpon>Resources.resx</DependentUpon>
8092
</Compile>
93+
<EmbeddedResource Include="PyinstallerSetting.resx">
94+
<DependentUpon>PyinstallerSetting.cs</DependentUpon>
95+
</EmbeddedResource>
96+
<EmbeddedResource Include="VerboseCommandExecutorForm.resx">
97+
<DependentUpon>VerboseCommandExecutorForm.cs</DependentUpon>
98+
</EmbeddedResource>
8199
<None Include="Properties\Settings.settings">
82100
<Generator>SettingsSingleFileGenerator</Generator>
83101
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

PyinstallerSetting.Designer.cs

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

0 commit comments

Comments
 (0)