We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

sonda
Posts: 103
Joined: Mon Apr 30, 2018 12:01 pm

Hide script code of custom action in verbose log

I have custom action and it calling a power shell script, if script fail in the log i can see all the code that script is executing but in this case i use for encrypting and decryption, it is possible script not to be shown in the log?
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Hide script code of custom action in verbose log

Hello Sonda,

Unfortunately, it is not possible to achieve that.

However, if you do not want your content to be shown in the log, maybe you can try to execute your PowerShell script through a "Run script from file" instead of "Run inline script" custom action.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sonda
Posts: 103
Joined: Mon Apr 30, 2018 12:01 pm

Re: Hide script code of custom action in verbose log

Hi Catalin, thanks for fast response i manage to reference assembly (dll) that have code for encryption in the power shell script with out exposing rest of the code and use that as custom action, previously all of the code i have placed in powershell now just referencing the dll and call of methods:

Ps file that will call as common action:

Code: Select all

#will create instance of a dll and call method
$assembly = [Reflection.Assembly]::LoadFile("C:\Path\TO\mY.dLL")
$instance = New-Object Encryption
$result = $instance.EncryptString("some secret")
Write-Host($result)
below is how it look class that is used in the project as dll and also in the installer for same purpose:

Code: Select all

 public class Encryption 
    {
      public string EncryptString(string text)
        {
        Code here ...
        };
        
        public string DecryptString(string cipherText)
        {
        code here ...
        };
    }



Regards
Last edited by sonda on Mon Jan 20, 2020 4:51 pm, edited 1 time in total.
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Hide script code of custom action in verbose log

Hello,

Thank you for your followup on this and for sharing your solution with us.

I am glad you found a workaround for this.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”