Add wix toolset script

This commit is contained in:
Mahmoud Gomaa committed 2024-12-03 18:39:36 +02:00
1 parent ed826e1780
commit 82a2a8750d
18 files changed
+138 -193

No files matched your search

+2 -2
View File
@@ -44,8 +44,8 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifact-${{matrix.configuration}}-${{matrix.platform}}
path: D:\a\Shell\Shell\src\bin\release\*
name: shell-${{matrix.platform}}
path: D:\a\Shell\Shell\src\bin\*
if-no-files-found: warn
retention-days: 0
compression-level: 6
+1 -1
View File
@@ -1,7 +1,7 @@
[![Ceasefire Now](https://badge.techforpalestine.org/default)](https://techforpalestine.org/learn-more)
[![Build](../../actions/workflows/msbuild.yml/badge.svg)](../../actions/workflows/msbuild.yml)
[![Nightly](https://img.shields.io/badge/download%20latest%20nightly%20build-nightly.link-purple)](https://nightly.link/moudey/Shell/workflows/msbuild/main)
[![Nightly](https://img.shields.io/badge/Nightly-nightly.link-purple)](https://nightly.link/moudey/Shell/workflows/msbuild/main)
# [Shell](https://nilesoft.org)
Powerful manager for Windows File Explorer context menu.
+2 -2
View File
@@ -9,7 +9,7 @@ set MM=%date:~4,2%
set DD=%date:~7,2%
set YYYY=%date:~10,4%
set PLATFORM=release\x64
set PLATFORM=x64
set dt=%YYYY%%MM%%DD%%TH%%TM%%TS%
set build=%YYYY%%MM%%DD%
@@ -20,7 +20,7 @@ set build=%YYYY%%MM%%DD%
:: Unregistering the Shell Extension.
::echo Proceeding with the Shell Extension unregistration.
echo.
echo Shell version 1.9 build 18 %date% %time%
echo Shell version 1.9 build 19 %date% %time%
echo.
cd /d %~dp0
+1 -37
View File
@@ -13,18 +13,6 @@
<Configuration>release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="debug|ARM64">
<Configuration>debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="debug|Win32">
<Configuration>debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="debug|x64">
<Configuration>debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
@@ -37,7 +25,7 @@
<TargetName>shell</TargetName>
<TargetExt>.dll</TargetExt>
<GenerateManifest>false</GenerateManifest>
<OutDir>$(SolutionDir)bin\$(Configuration.ToLower())\$(Platform.ToLower().Replace('win32', 'x86'))\</OutDir>
<OutDir>$(SolutionDir)bin\$(Platform.ToLower().Replace('win32', 'x86'))\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration.ToLower())\</IntDir>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
@@ -45,9 +33,6 @@
<CodeAnalysisRuleSet>NativeRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)'=='debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
@@ -68,9 +53,6 @@
<LibraryPath>$(SolutionDir)shared\Library;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProjectDir)src;$(ProjectDir)src\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='debug'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='release'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
@@ -118,24 +100,6 @@
<OutputFile>$(OutDir)$(TargetName)$(TargetExt).bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='debug'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<PreBuildEvent>
<Command>PowerShell.exe -NoProfile -NonInteractive -NoLogo -ExecutionPolicy Bypass -FILE "$(SolutionDir)tools\version\version.ps1"</Command>
<Message>Generating version number...</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='release'">
<ClCompile>
<IntrinsicFunctions>true</IntrinsicFunctions>
+1 -31
View File
@@ -1,18 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="debug|ARM64">
<Configuration>debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="debug|Win32">
<Configuration>debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="debug|x64">
<Configuration>debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="release|ARM64">
<Configuration>release</Configuration>
<Platform>ARM64</Platform>
@@ -39,7 +27,7 @@
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<OutDir>$(SolutionDir)bin\$(Configuration.ToLower())\$(Platform.ToLower().Replace('win32', 'x86'))\</OutDir>
<OutDir>$(SolutionDir)bin\$(Platform.ToLower().Replace('win32', 'x86'))\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration.ToLower())\</IntDir>
<GenerateManifest>false</GenerateManifest>
<ClCompile>
@@ -63,9 +51,6 @@
<PropertyGroup Label="Configuration" Condition="'$(Configuration)'=='release'">
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)'=='debug'">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
@@ -107,21 +92,6 @@
<MinimumRequiredVersion>6.1</MinimumRequiredVersion>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='debug'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SetChecksum>false</SetChecksum>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='release'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+1
View File
@@ -3,6 +3,7 @@
echo build setup...
echo.
cd wix
set arch=%~1
set bin=..\..\bin
+2 -2
View File
@@ -17,12 +17,12 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{F72D34CA-48DA-4DFD-91A9-A0C78BEF6981}</ProjectGuid>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<TargetName>ca_$(Platform.ToLower().Replace('win32', 'x86'))</TargetName>
<TargetName>ca</TargetName>
<CharacterSet>Unicode</CharacterSet>
<ProjectModuleDefinitionFile>ca.def</ProjectModuleDefinitionFile>
<Description>WiX Toolset CustomAction</Description>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<OutDir>$(SolutionDir)bin\</OutDir>
<OutDir>$(SolutionDir)bin\$(Platform.ToLower().Replace('win32', 'x86'))\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration.ToLower())\</IntDir>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+25 -19
View File
@@ -1,15 +1,14 @@
<?define Version = '1.9.18' ?>
<?include var.wxi ?>
<?define UpgradeCode = '{7BCA6512-254B-456F-8F08-AAD7508BEE00}' ?>
<?define Platform = '$(sys.BUILDARCH)' ?>
<?define Name = 'Shell' ?>
<?define Manufacturer = 'Nilesoft' ?>
<?define FullName = '$(var.Manufacturer) $(var.Name)' ?>
<?define Info = 'Powerful context menu manager for Windows File Explorer' ?>
<?define bin = '..\..\bin' ?>
<?define release = '$(var.bin)\release\$(var.Platform)' ?>
<?define config = '$(var.bin)' ?>
<?define release = '$(var.bin)\$(var.Platform)' ?>
<?define PlatformProgramFilesFolder = 'ProgramFiles6432Folder' ?>
<!--
@@ -29,7 +28,7 @@
InstallerVersion='500'
Compressed='yes'
Scope='perMachine'
ProductCode='{3025C475-D665-4288-99A8-3382654F7E11}'
ProductCode='$(var.ProductCode)'
UpgradeCode='$(var.UpgradeCode)'
Manufacturer='$(var.Manufacturer)'
Name='$(var.FullName)'
@@ -48,7 +47,7 @@
<Binary Id='WixUI_Bmp_New' SourceFile='res\WixUI_Bmp_New.bmp' />
<Binary Id='WixUI_Ico_Exclam' SourceFile='res\WixUI_Ico_Exclam.ico' />
<Binary Id='WixUI_Ico_Info' SourceFile='res\WixUI_Ico_Info.ico' />
<Binary Id='CA' SourceFile='$(var.bin)\ca_$(var.Platform).dll' />
<Binary Id='CA' SourceFile='$(var.bin)\$(var.Platform)\ca.dll' />
<Property Id='WIXUI_INSTALLDIR' Value='INSTALLFOLDER' />
<Property Id='WixUIRMOption' Value='UseRM' />
@@ -67,25 +66,31 @@
<Directory Id='INSTALLFOLDER' Name='$(var.FullName)'>
<Directory Id='IMPORTS' Name='imports'>
<Component Id='IMPORTS' Guid='{FF987BEA-6195-4C05-8523-00936A1BD0E2}' NeverOverwrite='yes'>
<File Id='theme.nss' Source='$(var.config)\imports\theme.nss' />
<File Id='goto.nss' KeyPath='yes' Source='$(var.config)\imports\goto.nss' />
<File Id='modify.nss' Source='$(var.config)\imports\modify.nss' />
<File Id='images.nss' Source='$(var.config)\imports\images.nss' />
<File Id='taskbar.nss' Source='$(var.config)\imports\taskbar.nss' />
<File Id='develop.nss' Source='$(var.config)\imports\develop.nss' />
<File Id='file_manage.nss' Source='$(var.config)\imports\file-manage.nss' />
<File Id='terminal.nss' Source='$(var.config)\imports\terminal.nss' />
<File Id='theme.nss' Source='$(var.bin)\imports\theme.nss' />
<File Id='goto.nss' KeyPath='yes' Source='$(var.bin)\imports\goto.nss' />
<File Id='modify.nss' Source='$(var.bin)\imports\modify.nss' />
<File Id='images.nss' Source='$(var.bin)\imports\images.nss' />
<File Id='taskbar.nss' Source='$(var.bin)\imports\taskbar.nss' />
<File Id='develop.nss' Source='$(var.bin)\imports\develop.nss' />
<File Id='file_manage.nss' Source='$(var.bin)\imports\file-manage.nss' />
<File Id='terminal.nss' Source='$(var.bin)\imports\terminal.nss' />
</Component>
<Directory Id='LANG' Name='lang'>
<Component Id='LANG' Guid='{FF987BEA-6195-4C05-8523-00936A1BD092}' NeverOverwrite='yes'>
<File Id='en.nss' Source='$(var.bin)\imports\lang\en.nss' />
<File Id='ar.nss' Source='$(var.bin)\imports\lang\ar.nss' />
</Component>
</Directory>
<Component Id='APPLICATION' Guid='{ED9EFE4B-E83D-42BB-8938-F72B13A2FAD2}'>
</Directory>
<Component Id='APPLICATION' Guid='{ED9EFE4B-E83D-42BB-8938-F72B13A2FAD2}'>
<CreateFolder Directory='INSTALLFOLDER' />
<File Id='shell.exe' Checksum='yes' Name='shell.exe' KeyPath='yes' Source='$(var.release)\shell.exe' />
<File Id='shell.dll' Checksum='yes' Name='shell.dll' Source='$(var.release)\shell.dll' />
<File Id='readme.txt' Name='readme.txt' Source='$(var.config)\readme.txt' />
<File Id='LICENSE' Name='LICENSE' Source='$(var.config)\LICENSE' />
<File Id='readme.txt' Name='readme.txt' Source='$(var.bin)\readme.txt' />
<File Id='license.txt' Name='LICENSE' Source='$(var.bin)\license.txt' />
</Component>
<Component Id='CONFIG' Guid='{BEC55C6A-30C7-4E1F-B64D-8636AB379E31}' NeverOverwrite='yes'>
<File Id='shell.nss' Name='shell.nss' KeyPath='yes' Source='$(var.config)\shell.nss' />
<File Id='shell.nss' Name='shell.nss' KeyPath='yes' Source='$(var.bin)\shell.nss' />
</Component>
<Component Id='CLEANUP' Guid='{838501CD-485B-4587-9195-6CFB416202B9}' KeyPath='yes'>
<RemoveFile Id='PurgeAppFiles' Name='*.*' On='uninstall' Directory='INSTALLFOLDER' />
@@ -106,13 +111,14 @@
</StandardDirectory>
<!--
<ComponentGroup Id="IMPORTFiles" Directory="IMPORTS">
<Files Include="$(var.config)\imports\*.nss" />
<Files Include="$(var.bin)\imports\*.nss" />
</ComponentGroup>
-->
<Feature Id='APPLICATION' Title='$(var.FullName)' Level='1'>
<ComponentRef Id='APPLICATION' />
<ComponentRef Id='CONFIG' />
<ComponentRef Id='IMPORTS' />
<ComponentRef Id='LANG' />
<ComponentRef Id='CLEANUP' />
<ComponentRef Id='StartMenuShortcut' />
<ComponentRef Id='DisplayIcon' />
+4
View File
@@ -0,0 +1,4 @@
<Include xmlns='http://wixtoolset.org/schemas/v4/wxs'>
<?define Version = '1.9.19' ?>
<?define ProductCode = '{7BCA6512-254B-456F-8F08-AAD7508BEE77}' ?>
</Include>
+15 -12
View File
@@ -2,14 +2,17 @@
namespace Nilesoft
{
static const auto REG_REGISTER = 0x01;
static const auto REG_UNREGISTER = 0x02;
static const auto REG_TREAT = 0x04;
static const auto REG_CONTEXTMENU = 0x08;
static const auto REG_FOLDEREXTENSIONS = 0x16;
static const auto REG_ICONOVERLAY = 0x32;
static const auto REG_RESTART = 0x64;
static const auto REG_SILENT = 0x128;
struct REGOP
{
bool REGISTER;
bool UNREGISTER;
bool TREAT;
bool CONTEXTMENU;
bool FOLDEREXTENSIONS;
bool ICONOVERLAY;
bool RESTART;
bool SILENT;
};
class RegistryConfig
{
@@ -98,7 +101,7 @@ namespace Nilesoft
}
// Require admininstrator's rights!
static bool Register(const wchar_t *dllPath, int fReg = REG_REGISTER | REG_CONTEXTMENU)
static bool Register(const wchar_t *dllPath, REGOP reg)
{
if(!dllPath || !dllPath[0])
return false;
@@ -108,7 +111,7 @@ namespace Nilesoft
int ret = 0;
if(fReg & REG_FOLDEREXTENSIONS)
if(reg.FOLDEREXTENSIONS)
{
if(RegisterInprocServer(dllPath, CLS_FolderExtensions, APP_COMP_NAME))
{
@@ -128,7 +131,7 @@ namespace Nilesoft
}
}
if(fReg & REG_ICONOVERLAY)
if(reg.ICONOVERLAY)
{
// register COM-object for overlay icon handler
if(RegisterInprocServer(dllPath, CLS_IconOverlay, APP_COMP_NAME))
@@ -138,7 +141,7 @@ namespace Nilesoft
}
}
if(fReg & REG_CONTEXTMENU)
if(reg.CONTEXTMENU)
{
// register COM-object for shortcut menu handler
if(RegisterInprocServer(dllPath, CLS_ContextMenu, APP_COMP_NAME))
+3 -3
View File
@@ -2,7 +2,7 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 9
#define VERSION_BUILD 17
#define VERSION_BUILD 19
#define VERSION_REV 0
#define VERSION_YEAR 2024
@@ -33,8 +33,8 @@ namespace Nilesoft
#define APP_FILENAME_TITLE L"shell"
#define APP_PRODUCT_VERSION L"1.9"
#define APP_VERSION L"1.9.17"
//#define APP_VERSION_FULL L"1.9 build 17"
#define APP_VERSION L"1.9.19"
//#define APP_VERSION_FULL L"1.9 build 19"
constexpr auto APP_EMAIL = L"support@nilesoft.org";
constexpr auto APP_WEBSITE = L"www.nilesoft.org";
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.9.17.0"
version="1.9.19.0"
processorArchitecture="*"
name="Nilesoft.Shell"
type="win32"
+46 -26
View File
@@ -86,45 +86,65 @@ namespace Nilesoft
}
}
static BOOL Start(const wchar_t* application, const wchar_t* parameters,
const wchar_t* directory, int showCmd, bool /*wait*/,
LPPROCESS_INFORMATION processInfo)
static BOOL Start(const wchar_t *commandLine, const wchar_t *directory = nullptr, bool wait = false, int showCmd = SW_SHOWNORMAL)
{
PROCESS_INFORMATION processInfo = { };
auto result = Start(nullptr, commandLine, directory, showCmd, &processInfo);
if(!result)
return FALSE;
STARTUPINFOW startupInfo = { 0 };
startupInfo.cb = sizeof(STARTUPINFOW);
startupInfo.wShowWindow = (WORD)showCmd;
// Wait until child process exits.
if(wait && processInfo.hProcess)
::WaitForSingleObject(processInfo.hProcess, INFINITE);
string commandLine;
if(parameters)
{
commandLine.format(L"\"%s\" %s", application, parameters);
}
const BOOL result = ::CreateProcessW(application,
commandLine, nullptr, nullptr, FALSE,
NORMAL_PRIORITY_CLASS,
nullptr, directory,
&startupInfo, processInfo);
// if(result && wait)
// ::WaitForSingleObject(processInfo->hProcess, INFINITE);
if(processInfo.hThread)
::CloseHandle(processInfo.hThread);
if(processInfo.hProcess)
::CloseHandle(processInfo.hProcess);
return result != 0;
return result;
}
static BOOL Start(const wchar_t* application, const wchar_t* parameters,
const wchar_t* directory = nullptr, bool wait = false, int showCmd = SW_SHOWNORMAL)
const wchar_t* directory, bool wait, int showCmd)
{
PROCESS_INFORMATION process = { 0 };
if(!Start(application, parameters, directory, showCmd, wait, &process))
PROCESS_INFORMATION processInfo = { };
if(!Start(application, parameters, directory, showCmd, &processInfo))
return FALSE;
// Wait until child process exits.
if(wait && processInfo.hProcess)
::WaitForSingleObject(processInfo.hProcess, INFINITE);
// Close process and thread handles.
if(process.hThread != nullptr)
::CloseHandle(process.hThread);
if(process.hProcess != nullptr)
::CloseHandle(process.hProcess);
if(processInfo.hThread)
::CloseHandle(processInfo.hThread);
if(processInfo.hProcess)
::CloseHandle(processInfo.hProcess);
return TRUE;
}
static BOOL Start(const wchar_t *application, const wchar_t *parameters,
const wchar_t *directory, int showCmd,
LPPROCESS_INFORMATION processInfo)
{
STARTUPINFOW startupInfo = { };
startupInfo.cb = sizeof(STARTUPINFOW);
startupInfo.wShowWindow = (WORD)showCmd;
startupInfo.dwFlags = STARTF_USESHOWWINDOW;
string commandLine = parameters;
/*
if(application && parameters)
commandLine.format(L"\"%s\" %s", application, parameters);
*/
return ::CreateProcessW(application,
commandLine, nullptr, nullptr, FALSE,
NORMAL_PRIORITY_CLASS,
nullptr, directory,
&startupInfo, processInfo);
}
static uint32_t EnumId(std::vector<DWORD> *lphProcesses)
{
uint32_t count = 0;
+27 -5
View File
@@ -335,6 +335,13 @@ namespace Nilesoft
::SendInput(1, &ip, sizeof(INPUT));
}
// https://stackoverflow.com/questions/5689904/gracefully-exit-explorer-programmatically
static BOOL Exit()
{
auto hWndTray = ::FindWindowExW(nullptr, nullptr, L"Shell_TrayWnd", nullptr);
return hWndTray ? ::PostMessageW(hWndTray, 0x5B4, 0, 0) : FALSE;
}
static void Refresh(bool all_windows = false)
{
//PostMessageW(::GetActiveWindow(), WM_KEYDOWN, VK_F5, NULL);
@@ -366,18 +373,18 @@ namespace Nilesoft
string params, cmd = sys_path;
cmd += L"\\cmd.exe";
params.format(L"/c taskkill /f /im explorer.exe && start %s\\explorer", win_path);
::ShellExecute(nullptr, nullptr, cmd, params, nullptr, SW_HIDE);
::ShellExecuteW(nullptr, nullptr, cmd, params, nullptr, SW_HIDE);
//WinExec("taskkill /f /im explorer.exe && start explorer.exe", SW_HIDE);
return res > 0;
}
for(auto &process : Nilesoft::Diagnostics::Process::EnumInfo())
{
if(process.th32ProcessID != 0)
if(process.th32ProcessID)
{
if(string::Equals(process.szExeFile, L"explorer.exe"))
{
if(auto hProcess = ::OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ | PROCESS_TERMINATE, FALSE,
if(auto hProcess = ::OpenProcess(PROCESS_TERMINATE, FALSE,
process.th32ProcessID); hProcess)
{
res += ::TerminateProcess(hProcess, 0);
@@ -389,6 +396,22 @@ namespace Nilesoft
return res > 0;
}
static bool Restart0()
{
if(auto hShell_TrayWnd = Window::FindTaskbar(); hShell_TrayWnd)
{
DWORD dwProcessId = 0;
if(::GetWindowThreadProcessId(hShell_TrayWnd, &dwProcessId) && dwProcessId)
{
if(auto hProcess = ::OpenProcess(PROCESS_TERMINATE, FALSE, dwProcessId); hProcess)
{
return ::TerminateProcess(hProcess, 0);
}
}
}
return false;
}
static bool Restart1()
{
if(auto hShell_TrayWnd = Window::FindTaskbar(); hShell_TrayWnd)
@@ -400,7 +423,6 @@ namespace Nilesoft
{
if(::TerminateProcess(hProcess, 0))
{
/*::Sleep(2000);
hShell_TrayWnd = Window::FindTaskbar();
if(!hShell_TrayWnd)
-45
View File
@@ -1,45 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
name="JR.Inno.Setup"
processorArchitecture="x86"
version="1.0.0.0"
type="win32"/>
<description>Inno Setup</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="x86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<file name="mpr.dll" loadFrom="%SystemRoot%\system32\" />
<file name="netapi32.dll" loadFrom="%SystemRoot%\system32\" />
<file name="netutils.dll" loadFrom="%SystemRoot%\system32\" />
<file name="version.dll" loadFrom="%SystemRoot%\system32\" />
</assembly>
+4
View File
@@ -0,0 +1,4 @@
<Include xmlns='http://wixtoolset.org/schemas/v4/wxs'>
<?define Version = '$MAJOR$.$MINOR$.$BUILD$' ?>
<?define ProductCode = '{7BCA6512-254B-456F-8F08-AAD7508BEE77}' ?>
</Include>
-5
View File
@@ -1,5 +0,0 @@
@echo off
::PowerShell.exe -ExecutionPolicy Unrestricted -FILE version.ps1
::PowerShell.exe -ExecutionPolicy Bypass -FILE version.ps1
cd %~dp0
PowerShell.exe -NoProfile -NonInteractive -NoLogo -ExecutionPolicy Bypass -FILE version.ps1
+3 -2
View File
@@ -75,10 +75,10 @@ function update-regex($content, $key, $val)
try
{
$ChangeBuild = 1
$ChangeBuild = 0
$ChangeRevis = 0
$___Build__ = 17 # auto increase
$___Build__ = 19 # auto increase
$___Revis__ = 0 # auto increase
$AppCompany = "Nilesoft"
@@ -118,6 +118,7 @@ try
#update "Shell.rc" "..\..\shared\Resource\Shell.rc";
update "manifest.xml" "..\..\shared\Resource\manifest.xml";
update "Shell.def" "..\..\dll\src\Shell.def";
update "var.wxi" "..\..\setup\wix\var.wxi";
update "debug.cmd" "..\..\bin\debug.cmd";
$content = (Get-Content $ScriptPath)