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

Yhanks in advance.
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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.
Answered 01/31/2006 by: brenthunter2005
Fifth Degree Brown Belt

Please log in to comment
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?
Answered 01/31/2006 by: carastlin
Senior Yellow Belt

Please log in to comment
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?
Answered 01/31/2006 by: brenthunter2005
Fifth Degree Brown Belt

Please log in to comment
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.
Answered 01/31/2006 by: carastlin
Senior Yellow Belt

Please log in to comment
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.
Answered 01/31/2006 by: brenthunter2005
Fifth Degree Brown Belt

Please log in to comment
Answer this question or Comment on this question for clarity