BlockExecution Function

Topics: Archive - General
Apr 25, 2014 at 2:01 PM
I've been unable to get any of my scripts use the -BlockExecution function, and I'm thinking its because I made customization to the Config.xml. I changed it to
<Toolkit_TempPath>C:\Installs\DeploymentToolKit Files</Toolkit_TempPath>
and I now receive this error anytime I attempt to use that function...
[25-04-2014 09:56:00] [Pre-Installation] Invoking Block-AppExecution Function...
[25-04-2014 09:56:00] [Pre-Installation] Could not find a part of the path 'C:\Installs\DeploymentToolKit Files\PSAppDeployToolkit'. (at Block-AppExecution, C:\<script Dir>\AppDeployToolkit\AppDeployToolkitMain.ps1: line 1954
at Show-InstallationWelcome, C:\<script Dir>\AppDeployToolkit\AppDeployToolkitMain.ps1: line 2458
at <ScriptBlock>, C:\<script Dir>\Deploy-Application.ps1: line 92)
[25-04-2014 09:56:00] [Pre-Installation] Displaying Dialog Box with message: [Could not find a part of the path 'C:\Installs\DeploymentToolKit Files\PSAppDeployToolkit'. (at Block-AppExecution, C:\<script Dir>\AppDeployToolkit\AppDeployToolkitMain.ps1: line 1954
at Show-InstallationWelcome, C:\<script Dir>\AppDeployToolkit\AppDeployToolkitMain.ps1: line 2458
at <ScriptBlock>, C:\<script Dir>\Deploy-Application.ps1: line 92)]...
[25-04-2014 09:56:15] [Pre-Installation] Dialog Box Response: OK
[25-04-2014 09:56:15] [Pre-Installation] Invoking UnBlock-AppExecution Function...
Is there something else I must change in order to have this custom Temp Dir work when using -BlockExecution?
Coordinator
Apr 29, 2014 at 12:50 PM
Hey, can you check something? Does "C:\Installs\DeploymentToolKit Files" exist? If so can you create a PSAppDeployToolkit folder underneath it and retest this? If it's just a matter that the folder doesn't exist I can quickly fix that.

Thanks, Dan
Apr 29, 2014 at 12:57 PM
That worked like a charm! I'm guessing there is nothing stating to force create the directory for TempPath if it doesn't already exist?
Coordinator
Apr 29, 2014 at 1:44 PM
I've just fixed this in the latest source. Can you download, remove the temp path folder and try again? It should create it automatically now.

Thanks, Dan
Apr 29, 2014 at 2:12 PM
Excellent, the changes in 3.1.2 fixed this. I appreciate your assistance Dan.
Coordinator
Apr 29, 2014 at 2:13 PM
Great :) One or two more things I want to try to iron out for the 3.1.2 release but it's solid as it is.
May 2, 2014 at 2:04 PM
Edited May 2, 2014 at 3:02 PM
Hi,

I just have the problem on XP machine.
It seems that by default you use "C:\Users\Public

<Toolkit_TempPath>C:\Users\Public</Toolkit_TempPath>

but this path doesn't exist on XP computer.

Would not it be better to use an environment variable? Like ALLUSERSPROFILE
'Cause the correction is to create the folder if it does not exist. This does not seem super clean. I know that Windows XP is no longer supported but there is still a little: D
May 2, 2014 at 6:50 PM
What version are you using? The custom TempPath function would work on the 3.1.2 which you can get from the source section, since its not been released as a version yet.
Coordinator
May 5, 2014 at 1:57 PM
I've made a commit to the source which respects variables.

<Toolkit_TempPath>C:\Users\Public</Toolkit_TempPath>

is now

<Toolkit_TempPath>$envPublic</Toolkit_TempPath>

which will use the correct Public folder.

Cheers, Dan
May 5, 2014 at 5:28 PM
Great ;-)