Thanks Daniel for your detailed answer.
I was always able to see the contents of TempFolder, but the folder I am adding is the one that is not present when executing the custom action.
I attach an example project that should show an empty messagebox when executing
Code: Select all
[System.Windows.Forms.Messagebox]::Show($(Get-ChildItem "$($TempFolder)Desktop"))
(Remove the .txt extension on this file)
Hopefully you can reproduce the behavior with the following steps:
- On the attached project, go to the custom action and search for the location of the script I also attached
- In Files and Folders remove the Desktop folder and add it again with the Add Temporary Folder button. You can use the folder C:\Users\Public\Desktop, ensuring it has at least one file on it
- Build the project and install the app
The messagebox will show the files that are on the Desktop folder. Also the Desktop folder is seen on the temp folder during installation and is removed after it finishes. This is I think the result you are getting.
Now:
- Uninstall the app so you can install a new build
- In Files and Folders of the project, delete the content of the Desktop folder, and in its properties change the Desktop folder to synchronized to the same source, C:\Users\Public\Desktop
- The Desktop folder will be filled with the same files but the text will be blue this time, and an icon on the folder will indicate it's synchronized
- Build the project and install the app again
Now the messagebox will be empty. Before pressing ok check the temp folder and you will see the Desktop folder is not there, but after pressing ok the folder will appear, and stay there even after the installation finishes.
Also I don't know if related but the project I attach logs all to a file. The MSI command line in Builds says: /L*V "[DesktopFolder]\[|ProductName]-Install.log"
Thanks again for your work on my behalf.
Leandro.