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 4 years and 1 month 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.
Product, version and build: Powershell Studio 2020 5.7.172
32 or 64 bit version of product: 64 bit
Operating system: Windows 10
32 or 64 bit OS: 64 bits
Hello,
Recently we have created a little program with Powershell Studio and we need to deploy it through all computers of the company, so we have created a MSI file. When we install the MSI file, it creates automatically the shortcuts in the Start Menu, but we need them to be installed in the users desktop. For this purpose we've found this guide https://www.sapien.com/blog/2019/08/15/ ... xecutable/ and it works, but for me it has two problems:
The create an delete scripts are needed to be copied in the installation folder to be executed.
The scripts won't be executed unless I change the Powershell execution Policy form "restricted".
I know I could sign this scripts and change the policy to "Allsigned", for example, but I think perhaps could be another way integrated with the MSI.
A custom action doesn't need to be a script. Package the script that does what you want as an executable and include that as a custom action in your MSI.
That will avoid the execution policy requirement.
Alexander Riedel wrote: ↑Sun Feb 09, 2020 11:43 pm
A custom action doesn't need to be a script. Package the script that does what you want as an executable and include that as a custom action in your MSI.
That will avoid the execution policy requirement.
Thanks Alexander, I'll give a try.
So, there would be a way to hide these executables on the INSTALLDIR?
When we install the MSI file with the two scripts as CUSTOM ACTION (or executables if we do what you suggested), it copies the main file program in the folder "%programfiles%\[name of the program]" as expected, but in this folder there are too copied the two scripts "CreateShortcut" and "DeleteShortcut". This files are what I would like to not be showed.
I am not sure why you want them to be invisible.
I am assuming here you do not want a user to just click on them and potentially delete shortcuts or duplicate them.
You can either package these exe's with an elevation manifest to prevent a regular user from running them. The installer runs elevated usually so they would execute just fine.
Or you can add a parameter -key 2834287347238434 (or some such number) to the exe. If present it does the job, if not, it just says "You are not authorized to perform this operation".
From the custom action you can just add that parameter and no user would ever know
You could add a hidden attribute to the files but I am not certain if the MSI will be able to execute hidden files. And they are easily discovered anyway. So I would not recommend that.
This topic is 4 years and 1 month 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.