/build/static/layout/Breadcrumb_cap_w.png

Directories

How I can create a msi that recieve the name of the destination directory by command line??

Yhanks in advance.

0 Comments   [ + ] Show comments

Answers (5)

Posted by: brenthunter2005 18 years ago
Fifth Degree Brown Belt
0
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:
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
Senior Yellow Belt
0
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?
Posted by: brenthunter2005 18 years ago
Fifth Degree Brown Belt
0
I'm finding it hard to understand this new problem. It almost appears that you have added the file details to the MSI, but maybe haven't compiled it or told the MSI where to find the uncompressed file etc.

Are you able to give me exact error details?
Posted by: carastlin 18 years ago
Senior Yellow Belt
0
The error is:

Error 1309. Error reading from file: C:\temp\program files\DIR\PRUEBA\file.txt. Verify that the fle exists and that you can access it.

I think is a problem in the path, because file.txt is in C:\
DIR is a property and PRUEBA is the directory i´ve create in ProgramFilesFolder.
Posted by: brenthunter2005 18 years ago
Fifth Degree Brown Belt
0
I think you have coded the MSI very wrong, because error 1309 is caused when the MSI can't find the source file to copy to the destination folder.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ