Hello,
Can I use simple PS script like this to delete the APPDIR & the .ps1 file or there is a proper AI variable ?
The answer to this is yes, and yes. The cmdlet that removes a file is indeed the
"Remove-Item" cmdlet.
In what regards your second question, yes, that is also possible. In your script, you can get the values of public properties. In our case, we need to retrieve the value of APPDIR since that is the directory we want to remove. To do so, you can proceed as it follows:
This will take the value of
APPDIR and store it in the
$var variable.
After doing so, the script may look as it follows:
Code: Select all
Remove-Item -Recurse "$var" -Force -Confirm:$false
In what regards this:
I am getting an error "Warning 4154: abAdobeCS6-PS prerequisite was not correctly installed. Continue with installation of Your Application ?".
This might happen due to your prerequisite's conditions. Please keep in mind that the conditions are evaluated twice:
- once before the installation. Here, the conditions must be false ==> the prerequisite will be installed
- once after the installation. Here, the conditions must be true ==> the prerequisite was correctly installed. Otherwise, the setup will think that the prerequisite was not correctly installed and it will spawn a message, like in your case.
This does not necesarily mean the prerequisite was not correctly installed, it is just a logic inserted by you in the main package to double check the installation.
As you can see, this is the case here (you have checked and the prerequisite was correctly installed, however you are still receiving the error).
With that being said, please double check the condition of your prerequisite and make sure it is evaluated as true after the installation of the prerequisite. To do so, please go to
"Prerequisites" page --> your prerequisite -->
"Install Conditions" tab.
A little example so we can better understand this. Let's consider your prerequisite does something unique only to it. For instance, let's consider that it writes a .txt file to C:\ directory.
In the
"Install Conditions" tab, the condition is a search for that file.
- before the installation of the prerequisite, the main setup will look for that file. Here, the setup will see that the file is not present (the condition is false), therefore it will install the prerequisite
- after the installation, it will check again if the file is present. Now, the file should be present (the condition should be true). If it is present, it will interpret this as a success and will continue with the installation. Otherwise, it will interpret this as a failure.
Hope this helps.
Best regards,
Catalin