Skip to content

Commit 8c46bfc

Browse files
committed
1.1.0 add 🐚 meta
1 parent 0ca7680 commit 8c46bfc

File tree

2 files changed

+60
-7
lines changed

2 files changed

+60
-7
lines changed

Main.cs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ string findOne(string[] arr, string key, string defaultVal)
3333
return one == null ? defaultVal : one;
3434
}
3535

36+
bool isFalsy(string str)
37+
{
38+
return str == "no" || str == "0" || str == "false";
39+
}
40+
3641
public Main()
3742
{
3843
Application.UseWaitCursor = false;
@@ -99,31 +104,37 @@ public Main()
99104
}
100105

101106
//MessageBox.Show(args.ToString());
102-
runExe(args.ToString(), exePath, getKey("window", null), getKey("style", null), getKey("dir", runDir), null, null);
107+
runExe(args.ToString(), exePath, getKey("shell", null), getKey("window", null), getKey("style", null), getKey("dir", runDir), null, null);
103108
}
104109

105110

106-
Process runExe(string arg, string exePath, string strWindow, string strShow, string workingDir, Action<object, EventArgs> onExit, StringBuilder outputBuilder)
111+
Process runExe(string arg, string exePath, string strShell, string strWindow, string strShow, string workingDir, Action<object, EventArgs> onExit, StringBuilder outputBuilder)
107112
{
108113

109114
Process myProcess = new Process();
110115

111116
ProcessStartInfo startInfo = new ProcessStartInfo();
112117

113-
startInfo.UseShellExecute = true;
118+
bool useShell = strShell !=null ? !isFalsy(strShell)
119+
: true;
120+
121+
startInfo.UseShellExecute = useShell;
122+
114123
startInfo.FileName = exePath;
115124

116125
string style = findOne(new string[] { "Normal", "Minimized", "Maximized", "Hidden", "Hide" }, strShow, "Normal");
117126
//MessageBox.Show(style);
118-
startInfo.WindowStyle = style == "Hidden" || style == "Hide" ? ProcessWindowStyle.Hidden
127+
bool isHide = style == "Hidden" || style == "Hide";
128+
startInfo.WindowStyle = isHide ? ProcessWindowStyle.Hidden
119129
: style == "Minimized" ? ProcessWindowStyle.Minimized
120130
: style == "Maximized" ? ProcessWindowStyle.Maximized
121131
: ProcessWindowStyle.Normal;
122132

123-
// ignored here, since UseShellExecute = true
124-
startInfo.CreateNoWindow = strWindow == "no" || strWindow == "0";
133+
// when UseShellExecute = true will be ignored
134+
startInfo.CreateNoWindow = isHide || isFalsy(strWindow);
135+
136+
//MessageBox.Show("" +workingDir+ startInfo.WindowStyle + useShell+ isHide + isFalsy(strWindow));
125137

126-
//MessageBox.Show(workingDir);
127138
if (workingDir != null) startInfo.WorkingDirectory = workingDir;
128139
startInfo.Arguments = arg;
129140

runapp.csproj

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,25 @@
1313
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
1414
<FileAlignment>512</FileAlignment>
1515
<ApplicationIcon>icon.ico</ApplicationIcon>
16+
<ManifestCertificateThumbprint>9CC7585869B6B569C279D469AD0965D5B08E2791</ManifestCertificateThumbprint>
17+
<ManifestKeyFile>runapp_TemporaryKey.pfx</ManifestKeyFile>
18+
<GenerateManifests>true</GenerateManifests>
19+
<SignManifests>true</SignManifests>
20+
<IsWebBootstrapper>false</IsWebBootstrapper>
21+
<PublishUrl>publish\</PublishUrl>
22+
<Install>true</Install>
23+
<InstallFrom>Disk</InstallFrom>
24+
<UpdateEnabled>false</UpdateEnabled>
25+
<UpdateMode>Foreground</UpdateMode>
26+
<UpdateInterval>7</UpdateInterval>
27+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
28+
<UpdatePeriodically>false</UpdatePeriodically>
29+
<UpdateRequired>false</UpdateRequired>
30+
<MapFileExtensions>true</MapFileExtensions>
31+
<ApplicationRevision>0</ApplicationRevision>
32+
<ApplicationVersion>1.1.0.0</ApplicationVersion>
33+
<UseApplicationTrust>false</UseApplicationTrust>
34+
<BootstrapperEnabled>true</BootstrapperEnabled>
1635
</PropertyGroup>
1736
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1837
<DebugSymbols>true</DebugSymbols>
@@ -65,6 +84,7 @@
6584
<Generator>SettingsSingleFileGenerator</Generator>
6685
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
6786
</None>
87+
<None Include="runapp_TemporaryKey.pfx" />
6888
<Compile Include="Properties\Settings.Designer.cs">
6989
<AutoGen>True</AutoGen>
7090
<DependentUpon>Settings.settings</DependentUpon>
@@ -74,6 +94,28 @@
7494
<ItemGroup>
7595
<Content Include="icon.ico" />
7696
</ItemGroup>
97+
<ItemGroup>
98+
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
99+
<Visible>False</Visible>
100+
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
101+
<Install>false</Install>
102+
</BootstrapperPackage>
103+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
104+
<Visible>False</Visible>
105+
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
106+
<Install>false</Install>
107+
</BootstrapperPackage>
108+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
109+
<Visible>False</Visible>
110+
<ProductName>.NET Framework 3.5</ProductName>
111+
<Install>true</Install>
112+
</BootstrapperPackage>
113+
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
114+
<Visible>False</Visible>
115+
<ProductName>Windows Installer 3.1</ProductName>
116+
<Install>true</Install>
117+
</BootstrapperPackage>
118+
</ItemGroup>
77119
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
78120
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
79121
Other similar extension points exist, see Microsoft.Common.targets.

0 commit comments

Comments
 (0)