From 53e7893e19a478ab1c65c1ad4cd01edeaa473bcb Mon Sep 17 00:00:00 2001 From: denikson Date: Sun, 9 Dec 2018 13:49:39 +0200 Subject: [PATCH] Add helper library to installer --- Installer/InstallerHelper/.gitignore | 244 ++++++++++++++++++ .../InstallerHelper/InstallerHelper.csproj | 86 ++++++ Installer/InstallerHelper/InstallerHelper.sln | 37 +++ .../InstallerHelper/MFInstallerHelpers.cs | 12 + .../Properties/AssemblyInfo.cs | 36 +++ Installer/InstallerHelper/packages.config | 4 + Installer/README.txt | 4 + Installer/installer.iss | 13 +- 8 files changed, 434 insertions(+), 2 deletions(-) create mode 100644 Installer/InstallerHelper/.gitignore create mode 100644 Installer/InstallerHelper/InstallerHelper.csproj create mode 100644 Installer/InstallerHelper/InstallerHelper.sln create mode 100644 Installer/InstallerHelper/MFInstallerHelpers.cs create mode 100644 Installer/InstallerHelper/Properties/AssemblyInfo.cs create mode 100644 Installer/InstallerHelper/packages.config diff --git a/Installer/InstallerHelper/.gitignore b/Installer/InstallerHelper/.gitignore new file mode 100644 index 0000000..551bbde --- /dev/null +++ b/Installer/InstallerHelper/.gitignore @@ -0,0 +1,244 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# Won't share vscode settings for now +.vscode/ + +Distribution/* +Build/* +**/Libs/*.dll +**/Libs/*.exe +!**/Libs/ZeroRpc.Net.dll +!**/Libs/MsgPack.dll + +.vs/ + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Roslyn cache directories +*.ide/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +#NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding addin-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# If using the old MSBuild-Integrated Package Restore, uncomment this: +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + +.DS_Store +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# Windows +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk +/.vs/ diff --git a/Installer/InstallerHelper/InstallerHelper.csproj b/Installer/InstallerHelper/InstallerHelper.csproj new file mode 100644 index 0000000..5b83a19 --- /dev/null +++ b/Installer/InstallerHelper/InstallerHelper.csproj @@ -0,0 +1,86 @@ + + + + + Debug + AnyCPU + {3107B9DD-F808-4EC0-A51E-B7E07BFD0204} + Library + Properties + InstallerHelper + InstallerHelper + v4.5 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + MinimumRecommendedRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + MinimumRecommendedRules.ruleset + + + + packages\UnmanagedExports.1.2.7\lib\net\RGiesecke.DllExport.Metadata.dll + False + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Installer/InstallerHelper/InstallerHelper.sln b/Installer/InstallerHelper/InstallerHelper.sln new file mode 100644 index 0000000..9fed330 --- /dev/null +++ b/Installer/InstallerHelper/InstallerHelper.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28010.2003 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InstallerHelper", "InstallerHelper.csproj", "{3107B9DD-F808-4EC0-A51E-B7E07BFD0204}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3107B9DD-F808-4EC0-A51E-B7E07BFD0204}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3107B9DD-F808-4EC0-A51E-B7E07BFD0204}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3107B9DD-F808-4EC0-A51E-B7E07BFD0204}.Debug|x64.ActiveCfg = Debug|x64 + {3107B9DD-F808-4EC0-A51E-B7E07BFD0204}.Debug|x64.Build.0 = Debug|x64 + {3107B9DD-F808-4EC0-A51E-B7E07BFD0204}.Debug|x86.ActiveCfg = Debug|x86 + {3107B9DD-F808-4EC0-A51E-B7E07BFD0204}.Debug|x86.Build.0 = Debug|x86 + {3107B9DD-F808-4EC0-A51E-B7E07BFD0204}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3107B9DD-F808-4EC0-A51E-B7E07BFD0204}.Release|Any CPU.Build.0 = Release|Any CPU + {3107B9DD-F808-4EC0-A51E-B7E07BFD0204}.Release|x64.ActiveCfg = Release|x64 + {3107B9DD-F808-4EC0-A51E-B7E07BFD0204}.Release|x64.Build.0 = Release|x64 + {3107B9DD-F808-4EC0-A51E-B7E07BFD0204}.Release|x86.ActiveCfg = Release|x86 + {3107B9DD-F808-4EC0-A51E-B7E07BFD0204}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F8532BDC-4CDA-4CA7-B6F8-967275AA1490} + EndGlobalSection +EndGlobal diff --git a/Installer/InstallerHelper/MFInstallerHelpers.cs b/Installer/InstallerHelper/MFInstallerHelpers.cs new file mode 100644 index 0000000..19ca5e6 --- /dev/null +++ b/Installer/InstallerHelper/MFInstallerHelpers.cs @@ -0,0 +1,12 @@ +using System.Diagnostics; +using System.Runtime.InteropServices; +using RGiesecke.DllExport; + +namespace InstallerHelper +{ + public static class MFInstallerHelpers + { + [DllExport("IsProcessOpened", CallingConvention.StdCall)] + public static bool IsProcessOpened([MarshalAs(UnmanagedType.LPWStr)] string friendlyName) => Process.GetProcessesByName(friendlyName).Length != 0; + } +} \ No newline at end of file diff --git a/Installer/InstallerHelper/Properties/AssemblyInfo.cs b/Installer/InstallerHelper/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b229d63 --- /dev/null +++ b/Installer/InstallerHelper/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 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("InstallerHelper")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("InstallerHelper")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3107b9dd-f808-4ec0-a51e-b7e07bfd0204")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Installer/InstallerHelper/packages.config b/Installer/InstallerHelper/packages.config new file mode 100644 index 0000000..f98ea96 --- /dev/null +++ b/Installer/InstallerHelper/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Installer/README.txt b/Installer/README.txt index d558dff..5741ba5 100644 --- a/Installer/README.txt +++ b/Installer/README.txt @@ -7,6 +7,10 @@ Maid Fiddler is a real-time game manipulation tool for COM3D2. Changelog: +* 1.0.4.0 + - Added auto-updater functionality + - Added "unlock everything in free mode" option + - Allow main window to be resized freely * 1.0.3.3 - Maid Fiddler will now automatically remove invalid skills when all skills are unlocked - Update codebase to work with COM 1.23 (WILL NOT WORK ON OLDER VERSIONS) diff --git a/Installer/installer.iss b/Installer/installer.iss index ef0ac6e..1070080 100644 --- a/Installer/installer.iss +++ b/Installer/installer.iss @@ -3,7 +3,7 @@ #define MyAppName "Maid Fiddler" #define MyAppPub "NeighTools" -#define MyAppVersion "1.0.3.3" +#define MyAppVersion "1.0.4.0" #define MyAppURL "https://github.com/denikson/COM3D2.MaidFiddler" #define MyAppExeName "maid_fiddler_qt.exe" @@ -37,6 +37,7 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{ Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1 [Files] +Source: "bin\InstallerHelper.dll"; DestDir: "{app}"; Flags: dontcopy Source: "bin\app\maid_fiddler_qt.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "bin\app\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "bin\plugin\*"; DestDir: "{code:GetInstallLocation}"; Flags: ignoreversion recursesubdirs createallsubdirs @@ -47,6 +48,9 @@ Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon [Code] +function IsProcessOpened(path: String) : Boolean; +external 'IsProcessOpened@files:InstallerHelper.dll stdcall'; + var HelperDirPage: TInputDirWizardPage; @@ -68,7 +72,12 @@ end; function NextButtonClick(CurPageID: Integer) : Boolean; begin - if (CurPageID = HelperDirPage.ID) and (not DirExists(AddBackslash(HelperDirPage.Values[0]) + 'Sybaris')) then + if (CurPageID = wpInfoBefore) and IsProcessOpened('COM3D2x64') then + begin + MsgBox('COM3D2 is detected to still be open!'#13#10'Please close COM3D2 before continuing.', mbError, MB_OK); + Result := False; + end + else if (CurPageID = HelperDirPage.ID) and (not DirExists(AddBackslash(HelperDirPage.Values[0]) + 'Sybaris')) then begin MsgBox('No Sybaris folder found in the given COM3D2 directory!'#13#10'Check that you have Sybaris 2 installed in the given directory.', mbError, MB_OK); Result := False;