I'm new to creating an MSI for deployment and what I need to do is simple. I just want to create a shortcut on the users' desktop after deploying an MSI through SCCM. Everything works fine except for that one detail.
I've included a shortcut file and a small batch file to copy that shortcut to the desktop in the MSI contents and I added a custom action to run the batch file at installation. It's not working and I don't know enough about the process to figure out what I'm missing.
What is the method for doing this?
Creating MSI with custom action
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
-
- Posts: 2
- Last visit: Thu Jan 30, 2020 10:53 am
Re: Creating MSI with custom action
When you say that it isn't working, are you referring to the custom action to run your batch file or are you unable to create the MSI?
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- mxtrinidad
- Posts: 399
- Last visit: Tue May 16, 2023 6:52 am
Re: Creating MSI with custom action
Don't use batch file! Use a PowerShell script to copy the shortcut to the user Desktop.
Sample *code below:
*Note: The code above shows hardcoded path. You could use PowerShell Global variables to make it more dinamic.
You need to add both the script and the shortcut file in the "Files/Folders" area after clicking on the PS script icon.
When done! You should have:
1. (Packaged Executable)
2. (Source Script)
The below that both the script and the *.lnk files listed.
Then, on the "Custom Actions" section, in the File field use arrow down to pick the script file name.
Follow the images: I found an issue as you can see in the attached image and I will consult with our developer to have it corrected on our next service release.
Please let us know if this clears the issue you were experiencing.
Thanks for your patience!
Sample *code below:
Code: Select all
#CopyShortcut.ps1
Copy-Item 'C:\Users\max_t\Documents\SAPIEN\PowerShell Studio\Files\MyAzureCloudShell\Staging\InstallShortcut\*.lnk' 'C:\Users\max_t\Desktop';
You need to add both the script and the shortcut file in the "Files/Folders" area after clicking on the PS script icon.
When done! You should have:
1. (Packaged Executable)
2. (Source Script)
The below that both the script and the *.lnk files listed.
Then, on the "Custom Actions" section, in the File field use arrow down to pick the script file name.
Follow the images: I found an issue as you can see in the attached image and I will consult with our developer to have it corrected on our next service release.
Please let us know if this clears the issue you were experiencing.
Thanks for your patience!
-
- Posts: 2
- Last visit: Thu Jan 30, 2020 10:53 am
Re: Creating MSI with custom action
The last couple of images with the folder INSTALLDIR seem to be where I went off the rails. I'll give that a whirl.
- mxtrinidad
- Posts: 399
- Last visit: Tue May 16, 2023 6:52 am