The complete folder structure has been changed or updated
This commit is contained in:
BIN
dev/Invoke-WindowsService/Install-WindowsService.ps1
Normal file
BIN
dev/Invoke-WindowsService/Install-WindowsService.ps1
Normal file
Binary file not shown.
129
dev/Invoke-WindowsService/Install-WindowsService_Caller.cmd
Normal file
129
dev/Invoke-WindowsService/Install-WindowsService_Caller.cmd
Normal file
@@ -0,0 +1,129 @@
|
||||
TITLE DIGITAL DATA - Run all files in directory
|
||||
@ECHO OFF
|
||||
REM ----------------------------------------------------------------------------
|
||||
REM This script runs all specified files in the current directory
|
||||
REM
|
||||
REM Returns: <NOTHING>
|
||||
REM ----------------------------------------------------------------------------
|
||||
REM Copyright (c) 2024 by Digital Data GmbH
|
||||
REM
|
||||
REM Digital Data GmbH • Ludwig-Rinn-Strasse 16 • D-35452 Heuchelheim
|
||||
REM Tel.: 0641/202360 • E-Mail: info-flow@digitaldata.works
|
||||
REM ----------------------------------------------------------------------------
|
||||
REM Creation Date / Author: 13.08.2015 / MK
|
||||
REM Version Date / Editor: 24.11.2024 / MK
|
||||
REM Version Number: 2.0.0.0
|
||||
|
||||
REM --------------------------------------------------------------
|
||||
REM ------------------------set variables-------------------------
|
||||
REM --------------------------------------------------------------
|
||||
|
||||
SET /A ADMINMODE=1
|
||||
SET FILEEXTENSION=*.ps1
|
||||
|
||||
SET POWERSHELL7EXE="C:\Program Files\PowerShell\7\pwsh.exe"
|
||||
SET POWERSHELL6EXE="C:\Program Files\PowerShell\6\pwsh.exe"
|
||||
SET POWERSHELLBUILDINEXE="C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
|
||||
|
||||
SET DIRECTORY="%cd%"
|
||||
SET /A COUNT=0
|
||||
SET LOGFILE="%cd%\error.log"
|
||||
|
||||
REM --------------------------------------------------------------
|
||||
REM ------------------------preparing part------------------------
|
||||
REM --------------------------------------------------------------
|
||||
|
||||
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
|
||||
ECHO Program Startup %date% at %time:~0,8% o'clock, on %computername%.
|
||||
|
||||
ECHO -
|
||||
IF !ADMINMODE! EQU 1 (ECHO WARNING: In AdminMode, network drives/files will maybe be unavailable! && timeout /T 15)
|
||||
|
||||
ECHO -
|
||||
ECHO Searching for PowerShell 7...
|
||||
IF EXIST "!POWERSHELL7EXE!" (
|
||||
ECHO Found PowerShell 7 on this system.
|
||||
SET POWERSHELLEXE=!POWERSHELL7EXE!
|
||||
) ELSE (
|
||||
ECHO WARNING: Did not found PowerShell 7 on this system
|
||||
ECHO This could lead to malfunctions. Check the ..._Readme.txt file
|
||||
timeout /T 15
|
||||
ECHO Searching for PowerShell 6...
|
||||
IF EXIST "!POWERSHELL6EXE!" (
|
||||
ECHO Found PowerShell 6 on this system.
|
||||
SET POWERSHELLEXE=!POWERSHELL6EXE!
|
||||
) ELSE (
|
||||
ECHO WARNING: Did not found PowerShell 6 on this system.
|
||||
ECHO This could lead to malfunctions. Check the ..._Readme.txt file.
|
||||
timeout /T 15
|
||||
ECHO Searching for old PowerShell buildin version...
|
||||
IF EXIST "!POWERSHELLBUILDINEXE!" (
|
||||
ECHO Found old PowerShell buildin version on this system.
|
||||
SET POWERSHELLEXE=!POWERSHELLBUILDINEXE!
|
||||
) ELSE (
|
||||
ECHO ERROR: Did not found any PowerShell on this system.
|
||||
ECHO Exiting, because of this issue...
|
||||
timeout /T 15
|
||||
GOTO exit
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
REM --------------------------------------------------------------
|
||||
REM ---------------------Running Scripts---------------------------
|
||||
REM --------------------------------------------------------------
|
||||
|
||||
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (
|
||||
SET /a COUNT+=1
|
||||
)
|
||||
|
||||
ECHO -
|
||||
ECHO Found %COUNT% File(s) with File Extension %FILEEXTENSION% in Directory:
|
||||
ECHO %DIRECTORY%
|
||||
|
||||
ECHO -
|
||||
ECHO Running these scripts now:
|
||||
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (
|
||||
|
||||
ECHO -
|
||||
SET "SCRIPT=%%f"
|
||||
ECHO Running script:
|
||||
ECHO !SCRIPT!
|
||||
|
||||
ECHO -
|
||||
SET "ARGUMENTS=-NoProfile -ExecutionPolicy Bypass -File \""!SCRIPT!\"""
|
||||
ECHO With Arguments:
|
||||
ECHO !ARGUMENTS!
|
||||
|
||||
ECHO -
|
||||
SET "SUBCOMMAND=Start-Process -FilePath '!POWERSHELLEXE!' -WindowStyle hidden -ArgumentList '!ARGUMENTS!' "
|
||||
ECHO Subcommand:
|
||||
ECHO !SUBCOMMAND!
|
||||
|
||||
ECHO -
|
||||
IF !ADMINMODE! EQU 1 (
|
||||
SET "COMMAND=Start-Process powershell.exe -WindowStyle hidden -Verb runas {!SUBCOMMAND!} "
|
||||
) ELSE (
|
||||
SET "COMMAND=Start-Process powershell.exe -WindowStyle hidden {!SUBCOMMAND!} "
|
||||
)
|
||||
ECHO In nested command:
|
||||
ECHO !COMMAND!
|
||||
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "!COMMAND!"
|
||||
|
||||
IF ERRORLEVEL 1 (
|
||||
ECHO There was an error running the script: !SCRIPT! >> !LOGFILE!
|
||||
)
|
||||
)
|
||||
|
||||
REM --------------------------------------------------------------
|
||||
REM -------------------------final part---------------------------
|
||||
REM --------------------------------------------------------------
|
||||
|
||||
:exit
|
||||
ENDLOCAL
|
||||
ECHO -
|
||||
ECHO Program Complete %date% at %time:~0,8% o'clock, on %computername%.
|
||||
ECHO This Window will close in:
|
||||
timeout /T 10
|
||||
exit
|
||||
15
dev/Invoke-WindowsService/Install-WindowsService_History.txt
Normal file
15
dev/Invoke-WindowsService/Install-WindowsService_History.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Version 1.0.0.0 - 21.11.2024
|
||||
NEW: -
|
||||
FIX: -
|
||||
CHG: -
|
||||
REM: -
|
||||
|
||||
-------------------------------------legend------------------------------------
|
||||
NEW: = Added a new functionality
|
||||
FIX: = Fixed a Issue with existing functionality
|
||||
CHG: = Changed a existing functionality
|
||||
REM: = Removed a functionality
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -0,0 +1,5 @@
|
||||
System Requirements
|
||||
|
||||
- PowerShell Version 6 or higher needs to be installed
|
||||
The path of the Powershell Exe needs to be set in the "Install-WindowsService_Caller.cmd" file.
|
||||
Like: SET POWERSHELLEXE="C:\Program Files\PowerShell\7\pwsh.exe"
|
||||
123
dev/Invoke-WindowsService/Install-WindowsService_Settings.ini
Normal file
123
dev/Invoke-WindowsService/Install-WindowsService_Settings.ini
Normal file
@@ -0,0 +1,123 @@
|
||||
####################################################################################################
|
||||
# Digital Data Configuration File (Template Date: 30.07.2016) #
|
||||
# UTF-8 Coding required! #
|
||||
# incl. FailSafe functions that are active when information is missing. #
|
||||
####################################################################################################
|
||||
|
||||
#==================================================================================================#
|
||||
########################################## General Setup ###########################################
|
||||
#==================================================================================================#
|
||||
|
||||
####################################################################################################
|
||||
# Path in which the log files will be stored. #
|
||||
# Example: E:\LogFiles\<ScriptName> #
|
||||
# FailSafe Setting is: <ScriptPath>\Logs #
|
||||
####################################################################################################
|
||||
LogPath =
|
||||
|
||||
####################################################################################################
|
||||
# Numerical value how long (in days) log files will be kept. ValidateRange is 0 - 1000 #
|
||||
# Setting the Value to 0 disables this Function. #
|
||||
# FailSafe Setting is: 60 #
|
||||
####################################################################################################
|
||||
LogFileKeepTime = 30
|
||||
|
||||
#==================================================================================================#
|
||||
########################################## Profile Setup ###########################################
|
||||
#==================================================================================================#
|
||||
|
||||
####################################################################################################
|
||||
# Define Profiles in this config file for the executing Script. #
|
||||
# Syntax: #
|
||||
# UninstallServiceProfile | InstallServiceProfile #
|
||||
####################################################################################################
|
||||
|
||||
####################################################################################################
|
||||
# UninstallServiceProfile #
|
||||
# This profile type stops and uninstalls existing services. #
|
||||
####################################################################################################
|
||||
# First Parameter: <ServiceName> #
|
||||
# Set the service name, you want to uninstall. #
|
||||
# Dont confuse name with display name! Check it via PS cmdlet "Get-Service" #
|
||||
# Example: DigitalDataServiceNr1 #
|
||||
####################################################################################################
|
||||
|
||||
####################################################################################################
|
||||
# InstallServiceProfile #
|
||||
# This profile type installs or updates existing services and starts them if needed. #
|
||||
# Updating a service can not overwrite the <FullPathToEXE>, in case a path needs to be changed, #
|
||||
# uninstall and install the service again! #
|
||||
####################################################################################################
|
||||
# First Parameter: <ServiceDisplayName> #
|
||||
# Set the service display name, you want to install. #
|
||||
# In the background the display name will be used for the service name, by removeing blank in it. #
|
||||
# Example: Digital Data Service Nr1 #
|
||||
#--------------------------------------------------------------------------------------------------#
|
||||
# Second Parameter: <FullPathToEXE> #
|
||||
# Set the absolut path the the service EXE: #
|
||||
# Example: D:\ProgramFiles\DigitalData\ServiceNr1 #
|
||||
#--------------------------------------------------------------------------------------------------#
|
||||
# Third Parameter: <StartupParameter> #
|
||||
# Set a parameter which will be used by starting the service. #
|
||||
# Keep empty if no parameter is needed. #
|
||||
# Example: -k netsvcs #
|
||||
# Example: /debug #
|
||||
#--------------------------------------------------------------------------------------------------#
|
||||
# Fourth Parameter: <StartupType> #
|
||||
# Set one of the following examples: #
|
||||
# Example: Automatic #
|
||||
# Example: Manual #
|
||||
# Example: Disabled #
|
||||
# Example: AutomaticDelayedStart #
|
||||
#--------------------------------------------------------------------------------------------------#
|
||||
# Fifth Parameter: <Action> #
|
||||
# Set if the new installed service should start immediately after installation. #
|
||||
# Example: InstallOnly #
|
||||
# Example: InstallAndStart #
|
||||
#--------------------------------------------------------------------------------------------------#
|
||||
# Sixth Parameter: <Description> #
|
||||
# Set the description of the service. #
|
||||
# Example: This is a nice service which helps you with some stuff. #
|
||||
#--------------------------------------------------------------------------------------------------#
|
||||
# Seventh Parameter: <ServiceUserName> #
|
||||
# Set the username which should run this service. #
|
||||
# Can only used in combination with <ServiceUserPassword>. #
|
||||
# By keeping this parameter emtpy, the local system account will run the service. #
|
||||
# Example: UserAccount #
|
||||
# Example: Administrator #
|
||||
# Example: domain\UserAccount #
|
||||
# Example: domain\Administrator #
|
||||
#--------------------------------------------------------------------------------------------------#
|
||||
# Eight Parameter: <ServiceUserPassword> #
|
||||
# Set the password which should run this service. #
|
||||
# Can only used in combination with <ServiceUserName>. #
|
||||
# By keeping this parameter emtpy, the local system account will run the service. #
|
||||
# Example: 12345 #
|
||||
# Example: password #
|
||||
# Example: securepassword #
|
||||
####################################################################################################
|
||||
|
||||
UninstallServiceProfile = DigitalDataEmail-Service
|
||||
#InstallServiceProfile = Digital Data Email-Service ; D:\ProgramFiles\Digital Data\Debug\DDEmailService.exe ; ; Manual ; InstallAndStart ; Sends emails from the Digital Data email pool.
|
||||
|
||||
#Example:
|
||||
#UninstallServiceProfile = MyNiceService
|
||||
|
||||
#InstallServiceProfile = My nice service ; D:\ProgramFiles\Myniceservice\program.exe ; ;Automatic ; InstallOnly ; This is a very nice service
|
||||
#InstallServiceProfile = My nice service ; D:\ProgramFiles\Myniceservice\program.exe ; -parameter1 ;Automatic ; InstallAndStart ; This is a very nice service ; domain\user ; password
|
||||
|
||||
#UninstallServiceProfile = DigitalDataEB-Creator
|
||||
#UninstallServiceProfile = DigitalDataEmail-Profiler
|
||||
#UninstallServiceProfile = DigitalDataeInvoice-Parser
|
||||
#UninstallServiceProfile = DigitalDataJobRunner
|
||||
#UninstallServiceProfile = DigitalDataEmail-Service
|
||||
#UninstallServiceProfile = DigitalDataWM-ResultHandler
|
||||
#UninstallServiceProfile = DigitalDataEDMI-Service
|
||||
|
||||
#InstallServiceProfile = Digital Data EB-Creator ; D:\ProgramFiles\Digital Data\DDEBCreator\SERVICE\EB_Creator.exe ; ; Manual ; InstallOnly ; Creates result reports for released documents.
|
||||
#InstallServiceProfile = Digital Data Email-Profiler ; D:\ProgramFiles\Digital Data\DDEmailProfiler\SERVICE\EmailProfiler.Service.exe ; ; Manual ; InstallOnly ; Monitors email inboxes and processes incoming emails and their attachments.
|
||||
#InstallServiceProfile = Digital Data eInvoice-Parser ; D:\ProgramFiles\Digital Data\DDZUGFeRDService\DDZUGFeRDService.exe ; ; Manual ; InstallOnly ; Validates electronic invoices and extracts data.
|
||||
#InstallServiceProfile = Digital Data JobRunner ; D:\ProgramFiles\Digital Data\DDJobRunner\SERVICE\DigitalData.Services.JobRunner.exe ; ; Manual ; InstallOnly ; Executes defined and configured jobs to synchronize master and transaction data.
|
||||
#InstallServiceProfile = Digital Data Email-Service ; D:\ProgramFiles\Digital Data\DDEmailService\SERVICE\DDEmailService.exe ; ; Manual ; InstallOnly ; Sends emails from the Digital Data email pool.
|
||||
#InstallServiceProfile = Digital Data WM-ResultHandler ; ; ; Manual ; InstallOnly ; Executes windream searches and processes the results according to profile specifications.
|
||||
#InstallServiceProfile = Digital Data EDMI-Service ; ; ; Manual ; InstallOnly ; Proxy Service for Digital Data Applications.
|
||||
Binary file not shown.
Reference in New Issue
Block a user