Skip to content

Commit

Permalink
Implemented installer and windows service.
Browse files Browse the repository at this point in the history
-Implemented the windows installer.
-Implamented Windows service.
-Changed db name.
-Changed db and other dependencies locations from appdata to program data.
-Refactored to fix bugs.
-Had to add file permissions to the program data folder to write to db.
-Fixed installer made it start service properly and copy data per machine.
  • Loading branch information
OSM-Made committed Oct 16, 2020
1 parent b15e34f commit 2174a2a
Show file tree
Hide file tree
Showing 119 changed files with 12,128 additions and 387 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,7 @@ paket-files/

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
*.pyc

#Installers
*.msi
42 changes: 42 additions & 0 deletions Executables/InstallUtil.InstallLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe assembly's progress.
The file is located at C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.InstallLog.

The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe assembly's progress.
The file is located at C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.InstallLog.

The Commit phase completed successfully.

The transacted install has completed.


The uninstall is beginning.
See the contents of the log file for the C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe assembly's progress.
The file is located at C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.InstallLog.

The uninstall has completed.

Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe assembly's progress.
The file is located at C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.InstallLog.

The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe assembly's progress.
The file is located at C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.InstallLog.

The Commit phase completed successfully.

The transacted install has completed.


The uninstall is beginning.
See the contents of the log file for the C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe assembly's progress.
The file is located at C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.InstallLog.

The uninstall has completed.
Binary file added Executables/OrbisLibCPP.dll
Binary file not shown.
Binary file added Executables/OrbisModuleManager.exe
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public OrbisModuleManager()
PS4.DefaultTarget.Events.ProcAttach += Events_ProcAttach;
PS4.DefaultTarget.Events.ProcDetach += Events_ProcDetach;
PS4.DefaultTarget.Events.ProcDie += Events_ProcDie;
PS4.Events.TargetAvailable += Events_TargetAvailable;
PS4.Events.DBTouched += Events_DBTouched;

//Make sure the target info is updated on start.
Expand All @@ -73,7 +74,6 @@ public OrbisModuleManager()
UpdateFTP();
}


#region Tool Strip

private void SettingsButton_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -269,6 +269,12 @@ private void Events_ProcAttach(object sender, OrbisSuite.Classes.ProcAttachEvent
ExecuteSecure(() => UpdateModuleList());
}

private void Events_TargetAvailable(object sender, TargetAvailableEvent e)
{
if (e.TargetName.Equals(PS4.TargetManagement.DefaultTarget.Name))
ExecuteSecure(() => UpdateModuleList());
}

#endregion

#region Module List
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,32 @@
<PropertyGroup>
<ApplicationIcon>orbis-razorCpuLiveUIx64_100.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="DarkUI">
<HintPath>..\Libraries\DarkUI.dll</HintPath>
<HintPath>..\..\Libraries\DarkUI.dll</HintPath>
</Reference>
<Reference Include="OrbisLib, Version=2.0.273.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Libraries\OrbisLib.dll</HintPath>
<Reference Include="OrbisLib">
<HintPath>..\..\Libraries\OrbisLib.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -67,7 +86,6 @@
<DependentUpon>OrbisModuleManager.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="OrbisModuleManager.resx">
<DependentUpon>OrbisModuleManager.cs</DependentUpon>
</EmbeddedResource>
Expand All @@ -76,6 +94,7 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
Expand Down Expand Up @@ -105,9 +124,8 @@
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Content Include="..\x64\Debug\OrbisLibCPP.dll">
<Content Include="..\..\x64\Debug\OrbisLibCPP.dll">
<Link>OrbisLibCPP.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="orbis-razorCpuLiveUIx64_100.ico" />
<Content Include="Orbis.ico" />
Expand All @@ -116,4 +134,7 @@
<None Include="Resources\document_16xLG.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>"C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe" /wildcards /t:winexe /out:../../../../$(ProjectName).exe $(ProjectName).exe *.dll /ndebug /targetplatform:"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1"</PostBuildEvent>
</PropertyGroup>
</Project>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OrbisModuleManager")]
[assembly: AssemblyTitle("Orbis Suite")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OrbisModuleManager")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyProduct("Orbis Suite")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.240.0")]
[assembly: AssemblyVersion("2.0.423.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
Binary file added Executables/OrbisNeighborhood.exe
Binary file not shown.
1 change: 1 addition & 0 deletions Executables/OrbisNeighborhood/OrbisNeighborhood.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ private void Button_Detach_Click(object sender, EventArgs e)

private void Events_DBTouched(object sender, DBTouchedEvent e)
{
Console.WriteLine("Data Base Touched.");
ExecuteSecure(() => UpdateSettings());
ExecuteSecure(() => UpdateTargetList());
}
Expand Down
39 changes: 35 additions & 4 deletions Executables/OrbisNeighborhood/OrbisNeighborhood.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,42 @@
<PropertyGroup>
<ApplicationIcon>OrbisNeighborhoodx64_4055.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Service|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Service\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="DarkUI, Version=1.0.20.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="DarkUI, Version=1.0.23.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Libraries\DarkUI.dll</HintPath>
</Reference>
<Reference Include="OrbisLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<Reference Include="OrbisLib">
<HintPath>..\..\Libraries\OrbisLib.dll</HintPath>
</Reference>
<Reference Include="System" />
Expand Down Expand Up @@ -113,10 +142,12 @@
<ItemGroup>
<Content Include="..\..\x64\Debug\OrbisLibCPP.dll">
<Link>OrbisLibCPP.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Orbis.ico" />
<Content Include="OrbisNeighborhoodx64_4055.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>"C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe" /wildcards /t:winexe /out:../../../../$(ProjectName).exe $(ProjectName).exe *.dll /ndebug /targetplatform:"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1"</PostBuildEvent>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion Executables/OrbisNeighborhood/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.309")]
[assembly: AssemblyVersion("2.0.352")]
[assembly: AssemblyFileVersion("1.0.0")]
42 changes: 42 additions & 0 deletions Executables/OrbisSuiteService.InstallLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Installing assembly 'C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe'.
Affected parameters are:
logtoconsole =
assemblypath = C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe
logfile = C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.InstallLog
Installing service OrbisSuiteService...
Service OrbisSuiteService has been successfully installed.
Creating EventLog source OrbisSuiteService in log Application...
Committing assembly 'C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe'.
Affected parameters are:
logtoconsole =
assemblypath = C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe
logfile = C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.InstallLog
Uninstalling assembly 'C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe'.
Affected parameters are:
logtoconsole =
assemblypath = C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe
logfile = C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.InstallLog
Removing EventLog source OrbisSuiteService.
Service OrbisSuiteService is being removed from the system...
Service OrbisSuiteService was successfully removed from the system.
Installing assembly 'C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe'.
Affected parameters are:
logtoconsole =
assemblypath = C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe
logfile = C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.InstallLog
Installing service OrbisSuiteService...
Service OrbisSuiteService has been successfully installed.
Creating EventLog source OrbisSuiteService in log Application...
Committing assembly 'C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe'.
Affected parameters are:
logtoconsole =
assemblypath = C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe
logfile = C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.InstallLog
Uninstalling assembly 'C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe'.
Affected parameters are:
logtoconsole =
assemblypath = C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.exe
logfile = C:\Users\Gregory\Source\Repos\Orbis Suite\Executables\OrbisSuiteService.InstallLog
Removing EventLog source OrbisSuiteService.
Service OrbisSuiteService is being removed from the system...
Service OrbisSuiteService was successfully removed from the system.
Binary file added Executables/OrbisSuiteService.exe
Binary file not shown.
7 changes: 2 additions & 5 deletions Executables/OrbisSuiteService/OrbisSuiteService.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 25 additions & 7 deletions Executables/OrbisSuiteService/OrbisSuiteService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,47 @@ namespace OrbisSuiteService
{
public partial class OrbisSuiteService : ServiceBase
{
[DllImport("OrbisWindowsServiceLib.dll", CallingConvention = CallingConvention.Cdecl)]
internal static extern void dummy();
bool RunService = true;

public OrbisSuiteService()
{
InitializeComponent();
}

public void OnDebug()
[DllImport("OrbisWindowsServiceLib.dll", CallingConvention = CallingConvention.Cdecl)]
internal static extern void StartLib();

[DllImport("OrbisWindowsServiceLib.dll", CallingConvention = CallingConvention.Cdecl)]
internal static extern void StopLib();

[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern bool SetDllDirectory(string lpPathName);

System.Threading.Thread hServiceThread;

void ServiceThread()
{
OnStart(null);
StartLib();
while (RunService) { Thread.Sleep(10); }
}

protected override void OnStart(string[] args)
{
dummy();
Console.WriteLine("Hello :)");
while (true) { Thread.Sleep(10); }
//System.Diagnostics.Debugger.Launch();

SetDllDirectory(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\Orbis Suite\\");

hServiceThread = new Thread(() => ServiceThread());
hServiceThread.Priority = ThreadPriority.Highest;
hServiceThread.IsBackground = true;
hServiceThread.Start();
}

protected override void OnStop()
{
StopLib();

RunService = false;
}
}
}
Loading

0 comments on commit 2174a2a

Please sign in to comment.