Skip to content

InternalError503/CodeCheckForTaskExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Check for scheduled task example for inno setup

About:

When searching the best way to check for a scheduled task in google search with inno setup there was no real information or examples could be found so i am sharing my code, Hopefully this example will help someone.

Example Usage:

Simply place the code example in the examples folder of inno setup installation directory.

How to traverse tasks:

  • If the task has no folder just use the task name 'TASKNAME'
  • If the task is in a folder use the folder name then backslash task name 'FOLDER\TASKNAME'
Example check for a task that has no folder:
	if (TaskExist('TASKNAME')) then
		begin
			msgbox('Your task was found!', mbInformation, MB_OK)
	end
Example check for a task that has a folder:
	if (TaskExist('FOLDER\TASKNAME')) then
		begin
			msgbox('Your task was found!', mbInformation, MB_OK)
	end
Example check for a task that has multiple folders:
	if (TaskExist('FOLDER\FOLDER\FOLDER\TASKNAME')) then
		begin
			msgbox('Your task was found!', mbInformation, MB_OK)
	end

Dynamic task names:

You can use ExpandConstant() in this field.

Example check for a task using ExpandConstant():
	if (TaskExist(ExpandConstant ('{#MyAppName}'))) then
		begin
			msgbox('Your task was found!', mbInformation, MB_OK)
	end
Example check for a task using multiple values in the ExpandConstant() field:
	if (TaskExist(ExpandConstant ('{#MyAppName}{#MyUserInput}'))) then
		begin
			msgbox('Your task was found!', mbInformation, MB_OK)
	end

License:

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this example code, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

THE EXAMPLE CODE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Releases

No releases published

Packages

No packages published