Install File 'As'

Got a problem you cannot solve? Try here.
asparagusx
Posts: 17
Joined: Thu Jul 02, 2009 7:14 am

Install File 'As'

Postby asparagusx » Tue Jul 14, 2009 4:56 am

Apologies if this is a stupid question! I would like to install a file, but 'rename' it in the process. I have a source file called 'splash.jpg' and would like to install to a sub folder of $TARGETDIR$ and also rename it at the same stage to then contents of a variable or 'hardwire' it to another name.

This is my 'required' line of MSICode :

Code: Select all

Install File ....\\splash.jpg to $TARGETDIR$\\SYSTEM\\DX.JPG


What the system is doing is to create a folder called DX.JPG and it then places splash.jpg into that sub folder - which is incorrect. I would like to place splash.jpg as DX.jpg in $TARGETDIR$\\SYSTEM.

Any ideas?

Anton

ALive
Posts: 109
Joined: Mon Apr 27, 2009 5:54 am
Location: Russia

Postby ALive » Tue Jul 14, 2009 6:23 am

Good question!
I've also encountered with this issue. For now I'm renaming the file during the build process (witch is not the best way, because we have a duplicated files) and then build the installer.

"Install Files As" would be a great feature!!!

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Tue Jul 14, 2009 7:57 am

This is currently not supported. I have added it to our wish list. I like the command name Install File As :)

Do you have any suggestions on implementing this command? Should it support single files only, or multiple files, etc.?
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

DanStutzman
Posts: 85
Joined: Wed Jun 10, 2009 10:36 am
Location: Philadelphia, PA
Contact:

Postby DanStutzman » Tue Jul 14, 2009 8:21 am

Definately multiple files. This would be nice for folders as well.

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Tue Jul 14, 2009 8:44 am

So how would you do an Install Files As over multiple files?
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

DanStutzman
Posts: 85
Joined: Wed Jun 10, 2009 10:36 am
Location: Philadelphia, PA
Contact:

Postby DanStutzman » Tue Jul 14, 2009 9:42 am

I would do simply do it as you would do for a single, just adding multiple lines to the GUI. To make it any more complex would be a debugging nightmare.

InstallFile(s)As

Source:
[TEXTBOX]
Destination:
[TEXTBOX]

Etc.

I would also add InstallFolderAS but because of ICE Validation it would have to be a one to one value.

Also, to conform with ICE validation, the InstallFile(s)As function would have to follow the following rules:

1. The files have to go to the same location.
2. Have to be part of the same component.
3. They have to be part of the same component GUID.
4. The function cannot change file extensions as this would also violate ICE validation.
5. This function would have to be disabled for all registered file types.


Actually when thinking about it, lets set multiple file on the back burner and just focus on keeping within Windows Installer rules for a single file and/or folder.

This is just off the top of my head with the new zero-day threats that just came out from MS.

asparagusx
Posts: 17
Joined: Thu Jul 02, 2009 7:14 am

Postby asparagusx » Tue Jul 14, 2009 11:35 am

I think it is also very important that variables could be used in the destination.

DanStutzman
Posts: 85
Joined: Wed Jun 10, 2009 10:36 am
Location: Philadelphia, PA
Contact:

Postby DanStutzman » Tue Jul 14, 2009 1:45 pm

asparagusx wrote:I think it is also very important that variables could be used in the destination.


That is a given. Variable handling is consistent no matter what the function.

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Tue Jul 14, 2009 3:05 pm

Thanks for the feedback, but my question was more related to how to represent/state a multiple-file rename operation with just two input fields (source files and target folder).
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

DanStutzman
Posts: 85
Joined: Wed Jun 10, 2009 10:36 am
Location: Philadelphia, PA
Contact:

Postby DanStutzman » Tue Jul 14, 2009 3:30 pm

MichaelNesmith wrote:Thanks for the feedback, but my question was more related to how to represent/state a multiple-file rename operation with just two input fields (source files and target folder).


If you are limited to two input fields, that means that you are basically creating a string and that is gonna get dirty really quickly and so I wouldn't. Actually, in accordance with ICE, I would not support multiple file renames, even though I recommended it.

I would do a simple 1 to 1 file rename function with the existing functions.

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Tue Jul 14, 2009 3:51 pm

Doesn't that severely restrict the usability of this new command though? Any other opinions?
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

ALive
Posts: 109
Joined: Mon Apr 27, 2009 5:54 am
Location: Russia

Postby ALive » Wed Jul 15, 2009 1:17 am

Agree with Dan. Making this command for a bunch of files simultaneously will be hard to implement. IMO, just two fields wont give much options for multiple file renaming. Maybe it should be just "Install File As" (without "s").
Again, IMO, the situation when you need to rename file during setup is not often.

Have a nice day!

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Wed Jul 15, 2009 6:07 am

Leaving the ICE issues aside (InstallAware always takes care of the icing on the cake automatically ;)), would you suggest any additional or different input fields - to facilitate multiple file renames in an intuitive and sensible way?
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

Chris Miller
Posts: 66
Joined: Fri Mar 09, 2007 9:46 am
Location: Albany, NY
Contact:

Postby Chris Miller » Mon Jul 27, 2009 3:30 pm

DanStutzman wrote:Definately multiple files. This would be nice for folders as well.

I'm curious, what would be the use case for multiple files? I can't picture the UI for the action being easy to work with. It would be easier to copy or rename the files before you build the installer.

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Mon Jul 27, 2009 3:46 pm

The same could be said of the single file scenario, could it not?
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 143 guests