Creating MSI with custom action

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
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.
This topic is 5 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
software_mcmillanpazdansmith
Posts: 2
Last visit: Thu Jan 30, 2020 10:53 am

Creating MSI with custom action

Post by software_mcmillanpazdansmith »

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?
User avatar
brittneyr
Site Admin
Posts: 1672
Last visit: Wed Apr 17, 2024 1:24 pm
Answers: 39
Been upvoted: 31 times

Re: Creating MSI with custom action

Post by brittneyr »

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.
User avatar
mxtrinidad
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

Re: Creating MSI with custom action

Post by mxtrinidad »

Don't use batch file! Use a PowerShell script to copy the shortcut to the user Desktop.
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';

*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.
MSI_01_2018-08-27_20-09-34.jpg
MSI_01_2018-08-27_20-09-34.jpg (121.61 KiB) Viewed 3550 times
Then, on the "Custom Actions" section, in the File field use arrow down to pick the script file name.
MSI_02_2018-08-27_20-09-34.jpg
MSI_02_2018-08-27_20-09-34.jpg (115.86 KiB) Viewed 3550 times
Follow the images:
MSI_03_2018-08-27_20-09-34.jpg
MSI_03_2018-08-27_20-09-34.jpg (177.9 KiB) Viewed 3550 times
MSI_04_2018-08-27_20-09-34.jpg
MSI_04_2018-08-27_20-09-34.jpg (116.93 KiB) Viewed 3550 times
MSI_05_2018-08-27_20-09-34.jpg
MSI_05_2018-08-27_20-09-34.jpg (163.93 KiB) Viewed 3550 times
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!
software_mcmillanpazdansmith
Posts: 2
Last visit: Thu Jan 30, 2020 10:53 am

Re: Creating MSI with custom action

Post by software_mcmillanpazdansmith »

The last couple of images with the folder INSTALLDIR seem to be where I went off the rails. I'll give that a whirl.
User avatar
mxtrinidad
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

Re: Creating MSI with custom action

Post by mxtrinidad »

OK! Please let us know how it went.

:)
This topic is 5 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.