Hello Alexis,
I apologize for forgetting to mention the file rename. Somehow it seems that I have missed that point.
As you have already stated, yes, that can be done through a custom action. All you want to do here can be achieved through a custom action. As for this moment, since you are new to Advanced Installer, let's try to forget the "Search" approach and try to solve your problem from a custom action only.
First of all, let me try to explain what a custom action is. Custom actions are actions entirely defined by the user. They can be executable files, dynamic linked libraries, Visual Basic scripts, JavaScript files or PowerShell script files. They can be scheduled at any time during the installation.
Before we try to implement our solution in Advanced Installer, let's see how we can achieve those said above (finding a folder and renaming it) outside of Advanced Installer. This can be done through a PowerShell Script. Here is a script which does what you want:
Code: Select all
$path = 'C:\Users\Catalin\Desktop\MyFolder'
if(Test-Path $path){
Rename-Item -Path $path -NewName "MyNewFolder"
}
Quick Explanation: The
$path variable stores the path to the folder that you want to be renamed. The
"Test-Path" cmdlet determines whether all elements of the path exist. It returns
"True" if all elements exist and
"False" if any is missing. The
"Rename-Item" cmdlet changes the name of a specified item. This cmdlet does not affect the content of the item being renamed.
Now that we have developed a solution, it is time to implement it in Advanced Installer. To do so, you can proceed as it follows:
- please go to
"Custom Actions" page.
- there add the
"Run PowerShell inline script" predefined custom action
with sequence. In order to add a custom action with sequence, simply press the
"Add custom action with sequence" button which is placed to the right side of the custom action's name.
- under
"#Your code goes here." comment, add the script content mentioned above.
- in order to make this custom action run at the begin of the installation, we have to schedule it to do so. In order to achieve this, simply drag and drop your custom action before the
"Searches" action group (under
"Wizard Dialogs Stage").
- now that you have correctly scheduled your custom action, click on it and under
"Dialogs Stage Condition" please
uncheck the
"Uninstall" and
"Maintenance" options.
Attached to this thread you can find a sample project, for your reference, where I have implemented the solution described above.
Hope this helps.
All the best,
Catalin
FOLLOW US
Get the latest news in Application Packaging