I am working on a PSADT script for a program whom their uninstaller is in the APPDATA folder. I'm having a hard time getting the path correct - here is what I have currently:
Do you think the issue is with the file path or would a different cmdlet be more appropriate for something like this? Since this uninstaller is coded to delete itself after its initialized, putting it in the Files folder under PSADT template is not an option.
Thank you. The app will eventually be deployed via Intune, so it's being installed as SYSTEM. Would your recommendation to use Start-ADTProcessAsUser apply in that case?
If you are using Start-ADTProcess and are running as System, $envLocalAppData would resolve to "C:\WINDOWS\system32\config\systemprofile\AppData\Local". Does the file exist there?
Edit: We will only running the install as SYSTEM when it is packaged as a Intune WinApp file. I'm just running as a local admin on my machine for testing - not sure if that helps but wanted to distinguish just in case.
Please excuse my newness, but I found the problem.
One thing I neglected to mention is that the script I am working on is actually installing TWO programs, but they are related and interact with each other. The install/uninstall process worked fine for the first application but the second one failed. I thought that with subsequent changes I was making for the secondary program having trouble, it would just ignore the first line calling for the uninstallation of the first program.
Nope. Because the first program was uninstalled with the previous test, the script was failing because it could no longer find the uninstaller for the first application in the code.
Anyway. Once I removed the lines for testing, install/uninstall process now works thanks to making a slight revision to the code (which you lovely folks helped with).
Thank you. I am still very new, still learning. Appreciate your help and patience!