Directories
How I can create a msi that recieve the name of the destination directory by command line??
Yhanks in advance.
Yhanks in advance.
0 Comments
[ + ] Show comments
Answers (5)
Please log in to answer
Posted by:
brenthunter2005
18 years ago
You are asking a pretty hefty question really.
You can set the directory via a public property on the command line. This will copy the directory into the MSI property table. Example:
You now need to create a directory in your MSI somewhere. When you create this new directory in your MSI, think of it as your default directory if the user doesn't specify it on the command-line.
Now comes the main part. You need to add a custom action that will change the "default" directory you just created, to the directory specified on the command-line.
In Wise, use the "Set Directory" custom action.
You should also condition this custom action, so that it doesn't run if the public property is null. eg: Not MYDIRECTORY=""
Thats basically it, but remember to read up on each section in the Windows Installer SDK.
You can set the directory via a public property on the command line. This will copy the directory into the MSI property table. Example:
msiexec /i "name_of_package.msi" MYDIRECTORY="c:\program files\app_destination\etc"
You now need to create a directory in your MSI somewhere. When you create this new directory in your MSI, think of it as your default directory if the user doesn't specify it on the command-line.
Now comes the main part. You need to add a custom action that will change the "default" directory you just created, to the directory specified on the command-line.
In Wise, use the "Set Directory" custom action.
You should also condition this custom action, so that it doesn't run if the public property is null. eg: Not MYDIRECTORY=""
Thats basically it, but remember to read up on each section in the Windows Installer SDK.
Posted by:
carastlin
18 years ago
That´s right, i created a directory and i add a costum action to specify the default with the specified directory and it works.
Now i´m trying to add an existing file in this new directory but when i try to install, installer shows an error saying i can´t access to this file, verify that it exists or you have privileges... I´ve created an entry for this file in the directory in MSI, but the error continues existing... is a privileges problem? (i thnk i can solve this with cacls command) or is another thing that i don´t know at this moment?
Now i´m trying to add an existing file in this new directory but when i try to install, installer shows an error saying i can´t access to this file, verify that it exists or you have privileges... I´ve created an entry for this file in the directory in MSI, but the error continues existing... is a privileges problem? (i thnk i can solve this with cacls command) or is another thing that i don´t know at this moment?
Posted by:
brenthunter2005
18 years ago
Posted by:
carastlin
18 years ago
Posted by:
brenthunter2005
18 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.