-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refresh-Desktop is not refreshing the global environment block #37
Comments
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. |
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. |
Perform your test as follows:
|
The change required to resolve the issue is to make the following change to AppDeployToolkitMain.cs:
old:
|
Thanks for the update. I've implemented the fix in the latest beta. |
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 |
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? |
According to help the Refresh-Desktop method refreshes the desktop icons, however, AppDeployToolkitMain.cs also mentions it will update environment variables (i.e. public static void RefreshDesktopAndEnvironmentVariables()). In performing testing I do not find indication that the environment block is actually refreshing. I have very similar code I added to my extensions which does refresh the environment. I was wondering if we can fix the existing SendMessageTimeout to pass the proper params to also allow refresh of the environment block? See my extension code below:
The text was updated successfully, but these errors were encountered: