sujai.mca
Posts: 18
Joined: Mon Aug 18, 2014 6:55 am

to run a windows power shell script

hi, i need to run a windows powershell script "Set-ExecutionPolicy Unrestricted". its a oneline script. custom script action is asking for parameters and script body. what to give in those areas. what about the execution time? which option do i need to select. can anyone help me out...
Thanks in advance...
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: to run a windows power shell script

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

Our "Run Windows PowerShell Script" predefined custom action uses by default the Bypass Windows PowerShell execution policy. Unfortunately, we don't have support to change the Windows PowerShell execution policy for a script launched using the "Run Windows PowerShell Script" predefined custom action.

The execution time and execution options settings are not specific only to PowerShell custom actions. They are generic settings used by all Windows Installer custom actions. Please take a look on our "Custom Action Properties" article. For example,if you need to access an installer property within your custom action, then you should configure the custom action to run as immediate. If you need to run your custom action after the installation resources (e.g. files, registries, etc) have been deployed on target machine, then you should configure it to run as deferred (scheduled after the "Install Execution Stage -> Add Resources" actions group).

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sujai.mca
Posts: 18
Joined: Mon Aug 18, 2014 6:55 am

Re: to run a windows power shell script

thanks a lot...
I have another question. :?:
During the installation process after the welcome wizard, i have added a new dialogue which consists of user name field and emailID, the user will enter the input and when they click the next button a mail will be sent to the respective mail id, which consists the product key. In the next dialogue the user will me prompted that he has sent a product key through mail and he should enter it in the next dialogue...
I designed the dialogues, but i dono how to get the user input and handle them. do i need to write any code for these actions? :? :? :?
Can u please help me out...
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: to run a windows power shell script

Hello,

We don't have predefined functionality to send emails (e.g. based on user input address). However, you can develop your own custom action which will get the value of the property associated with your email edit box control and send an email to the extracted address. For example you can create a C# custom action or a C++ custom action. Then you can launch your custom action on a button push.

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sujai.mca
Posts: 18
Joined: Mon Aug 18, 2014 6:55 am

Re: to run a windows power shell script

That one helped me...

But i need to take the text from the email edit box and i need it to use in the code... I took the property associated with the email edit box control, but i dono how to use it in the C# code. If i use the property directly then its generating a error that 'the name "EDIT_2_PROP"(property name) does not exist in the current context'. So how can i fetch the value from the edit control box to the code?

Regards
-Sujai
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: to run a windows power shell script

Hello Sujai,

In order to get a property value within a C# custom action you should use the following statement:

Code: Select all

YourVariable = session["EDIT_2_PROP"];
Also, for setting a property within C# custom action you should use the following statement:

Code: Select all

session["EDIT_2_PROP"] = "YOUR_VALUE";
If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sujai.mca
Posts: 18
Joined: Mon Aug 18, 2014 6:55 am

Re: to run a windows power shell script

Thanks a lot bro...
Now i added the file in the "New custom action" and selected "call a function in dll" and then added the respective dll file to the project. Now how can i link this custom action to the dialogue that i have created? What i did is correct or not? I have no idea... I didnt find any option to do that. can u help me?
Thanks in advance...
-Sujai
sujai.mca
Posts: 18
Joined: Mon Aug 18, 2014 6:55 am

Re: to run a windows power shell script

I found a solution for that... Now its working fine...
Thank you dude... If i have any doubt, i ll get back to you... :)
Regards...
-Sujai
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: to run a windows power shell script

You're welcome Sujai. I'm glad you got this working.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sujai.mca
Posts: 18
Joined: Mon Aug 18, 2014 6:55 am

Re: to run a windows power shell script

Hi dude, I need another help.
When installing the package that has been developed using Advanced Installer, it states "Unknown Publisher". How can i add a publisher name to the package?
Thanks...
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: to run a windows power shell script

Hello,

In order to be displayed a publisher name in the UAC prompt you should sign the installation setup. Also, please take a look on the "Why does the "Unknown Publisher" message appear during the install of a digitally signed package?" faq.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sujai.mca
Posts: 18
Joined: Mon Aug 18, 2014 6:55 am

Re: to run a windows power shell script

I got a trial code signing certificate and i installed it in my computer and also added it to the digital signature page of Advanced Installer. Its working fine in my PC. It shows the Publisher name during the installation process. But when i try installing the setup in other PC, the publisher name still remains unknown... :? :? :? Can u help me out...
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: to run a windows power shell script

Hello,

This may happen if the certificate you are using is issued by a certificate provider which is not in the Member List of the Windows Root Certificate Program. In this case, to avoid this behavior you should import your certificate in the Certificate Store of your target machines. Please take a look on the "Import a Certificate" article.

Also, in order to get more details about the root cause of this behavior you can try to contact the support team of your certificate provider.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sujai.mca
Posts: 18
Joined: Mon Aug 18, 2014 6:55 am

Re: to run a windows power shell script

Can u please refer me a trusted provider where i can get a trial certificate...
Thanks...
sujai.mca
Posts: 18
Joined: Mon Aug 18, 2014 6:55 am

Re: to run a windows power shell script

Sir i need another clarification...
I need to store the state or session of the installer temporarily. If the user closes the installer in the middle, and if they open the installer again then it should start from the dialog where the installer was closed, it should not start from the beginning. Can i maintain the state or session of the installer? Is this possible?

Return to “Feature Requests”