Comments (7)
Please post code in code blocks so it's easier to read. You can do so by surround the code block with three back ticks before and after (I edited your post to add the code block).
Refresh-Desktop will refresh desktop icons and also update the environment block for Windows Explorer so that new processes that are spawned reflect the newly created environment variables. Processes load environment variables at initial start and then it is impossible to update the environment block for that process unless you restart the process. If you need to use an environment variable you just created in the same process that created it, then make a call to Refresh-SessionEnvironmentVariables.
from psappdeploytoolkit.
Please explain in detail what behaviour you notice when using the custom code you posted above vs the behaviour you notice when you use the code in the toolkit. That will give me a better understanding of the issue and what I need to fix.
from psappdeploytoolkit.
Perform your test as follows:
- Open Regedit and change the PATH value located at: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment;Path
- Open a command prompt and type SET. Note the value for PATH. It will not reflect your change.
- Run Refresh-Desktop
- Open a new command prompt and type SET. Note the value still reflects the value you saw in step #2.
- Run Refresh-GlobalEnvironment
- Open a new command prompt and type SET. Note the value for PATH now reflects the change you made in step 1.
from psappdeploytoolkit.
The change required to resolve the issue is to make the following change to AppDeployToolkitMain.cs:
new:
public static void RefreshDesktopAndEnvironmentVariables()
{
// Update desktop icons
SHChangeNotify(0x8000000, 0x1000, IntPtr.Zero, IntPtr.Zero);
// Update environment variables
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, IntPtr.Zero, "Environment", SMTO_ABORTIFHUNG, 100, IntPtr.Zero);
}
old:
public static void RefreshDesktopAndEnvironmentVariables()
{
// Update desktop icons
SHChangeNotify(0x8000000, 0x1000, IntPtr.Zero, IntPtr.Zero);
// Update environment variables
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, IntPtr.Zero, null, SMTO_ABORTIFHUNG, 100, IntPtr.Zero);
}
from psappdeploytoolkit.
Thanks for the update. I've implemented the fix in the latest beta.
from psappdeploytoolkit.
Hello, we are running version 3.8.1 of the toolkit and seen where the explorer.exe process is stopped during the installation step using Execute-Msi function. It sounds to me it's happening during the [Installation] :: Refresh the Desktop and the Windows Explorer environment process block. Update-Desktop 8/6/2020 3:51:08 PM 16600 (0x40D8) Step. The package completes running to post-installation step, however then user has to sign in and out to get explorer back or launch taskmgr and initiate explorer.exe. Would appreciate any feedback, thanks
from psappdeploytoolkit.
The package completes running to post-installation step, however then user has to sign in and out to get explorer back or launch taskmgr and initiate explorer.exe. Would appreciate any feedback, thanks
I am using 3.8.4 and I started receiving this same issue in about March 2022. Did you ever get a response on this?
from psappdeploytoolkit.
Related Issues (20)
- Deployment of MSI shows error but succeeds HOT 3
- Is the goal of this if statement in Write-Log to allow for the creation of blank log lines? HOT 4
- Show-InstallationPrompt: Add ability to prompt for free text value HOT 1
- Remove-Folder HOT 3
- Configure-EdgeExtension error after ExtensionSettings created with empty string value HOT 1
- BREAK : Interactive & Allow users to interact with this program HOT 9
- [PSADT.UiAutomation] does not contain a method named 'SetProcessDPIAware' HOT 12
- The custom welcome message in the XML file HOT 1
- Zip Structure folder changed after v3.9.2 HOT 1
- How to use the AppDeployToolkit with Ivanti EndPoint Manager ? HOT 2
- PSAppDeployToolkit version 3.10.0 Deploy-Application.exe doesn't start when display language is set to Finnish HOT 1
- Show-InstallationWelcome not prompting to close software when pushed as a system account HOT 11
- Update Function Show-InstallationWelcome HOT 4
- "QuietUninstallString" and "WindowsInstaller" in Get-InstalledApplication (Follow-up of: https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/issues/652) HOT 2
- ClosePrompt_ButtonClose to small with german text HOT 5
- Is this a dead variable? HOT 3
- [Bug] Configure-EdgeExtension errors on line 16517 char:40 - Add-Member : Cannot bind argument to parameter 'InputObject' because it is null. HOT 1
- [tanslation] <BalloonText_FastRetry> German Translastion
- [Bug] HOT 1
- Incorrect information with 'Set-ItemPermission' reference in docs - 'https://psappdeploytoolkit.com/docs/reference/functions/Set-ItemPermission/' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psappdeploytoolkit.