Keep the folder Name where ever you install the application

Got a problem you cannot solve? Try here.
Doron
Posts: 20
Joined: Mon Nov 27, 2006 4:36 pm
Location: USA

Keep the folder Name where ever you install the application

Postby Doron » Mon Mar 05, 2007 10:14 am

Hi Andy,

How would you modify the code if I need to use the original Destination dialog box but no matter what Target I choose the installation folder name always stays the same. So I can install it even within a sub folder. Obviously the text field the Enabled property will be False.

Please advise.

Thanks,

Doron

neillans
Posts: 536
Joined: Sat Nov 04, 2006 6:21 am
Location: Scottish Borders, UK
Contact:

Postby neillans » Mon Mar 05, 2007 1:09 pm

Not quite sure I follow you; can you give me an example?

Do you mean have the user select a folder, and then always install in a folder of a fixed name under that selected folder?
Andy Neillans

Doron
Posts: 20
Joined: Mon Nov 27, 2006 4:36 pm
Location: USA

Keep the installation folder

Postby Doron » Mon Mar 05, 2007 4:46 pm

Hi Andy,

Do you mean have the user select a folder, and then always install in a folder of a fixed name under that selected folder?


That’s exactly what I mean. If the installation folder is XYZ then the user will never be able to change the folder name but can install it either in the root of the hard disk or under a sub folder, like C:\\Program Names\\XYZ or E:\\XYZ.

The XYZ name can not be changed by the user.

Thanks,

Doron

neillans
Posts: 536
Joined: Sat Nov 04, 2006 6:21 am
Location: Scottish Borders, UK
Contact:

Postby neillans » Tue Mar 06, 2007 11:20 am

The easiest way to do this, I think, is probably override the TARGETDIR variable after the destination dialog has appeared; simply append a value to it representing the fixed directory.
Andy Neillans

Doron
Posts: 20
Joined: Mon Nov 27, 2006 4:36 pm
Location: USA

Keep the install folder

Postby Doron » Tue Mar 06, 2007 11:30 am

Hi Andy,

When you have a chance please provide some sample code to show us how to accomplish that.

Thanks,

Doron

neillans
Posts: 536
Joined: Sat Nov 04, 2006 6:21 am
Location: Scottish Borders, UK
Contact:

Postby neillans » Tue Mar 06, 2007 4:03 pm

Hi Doron,

Please have a look at the attached; I've modified the script and the Destination dialog (just to give you an example). Code modifications are commented, but should be fairly easy to follow.

Hope this helps!

File Attached:

Fixed Path Demo.zip
Andy Neillans

Doron
Posts: 20
Joined: Mon Nov 27, 2006 4:36 pm
Location: USA

Keep the installation folder

Postby Doron » Tue Mar 06, 2007 8:03 pm

Hi Andy,

Thanks for your reply.

I run the sample code and when selected a different drive it shows only the drive letter as D:\\ and did not keep the installation folder as well.

I guess something was missed. :)


Thanks,

Doron

neillans
Posts: 536
Joined: Sat Nov 04, 2006 6:21 am
Location: Scottish Borders, UK
Contact:

Postby neillans » Wed Mar 07, 2007 2:59 am

Oops :?

I'll double check - I only tested with a complete folder path, not a single drive :)
Andy Neillans

neillans
Posts: 536
Joined: Sat Nov 04, 2006 6:21 am
Location: Scottish Borders, UK
Contact:

Postby neillans » Wed Mar 07, 2007 3:26 am

Hi Doron,

Just tested, seems to work correctly when you specify a drive as the target.

Please see the attached screenshot; if you run the Debug build in InstallAware, you should see the same - check the TargetDir watch during the installation - this should give you a hint as to what is wrong.

Also, be sure that the setup installs at least one valid file; if it does not, then the TargetDir is not created (my sample tries to include win.ini :)).

File Attached:

Screenshot.jpg
Andy Neillans

Doron
Posts: 20
Joined: Mon Nov 27, 2006 4:36 pm
Location: USA

Keep always the installtion folder

Postby Doron » Wed Mar 07, 2007 9:55 am

Hi Andy,

Thanks for the screenshot, and that is the actual problem and please see the below. :)

1)Initially it shows the C:\\Programs Files
2)Then if I select drive E it shows E:
3)Then If I click Next it shows Fixed Path Demo
4)Then If I click back it shows E:\\Fixed Path Demo

In step 2 it should have shown already the full path as:
E:\\Fixed Path Demo
and that’s created the confusion.

Also I had to fix the code in the line 159 to
Set Variable TARGETDIR TO $TARGETDIR$$FIXEDDIR$
I had to remove the back slash so it will not show the path as:
E:\\\\Fixed Path Demo

Before I got to my own project I am trying to see how your proj works first, so I did not install anything yet.

Maybe step 2 could be improved.

Thanks,

Doron

neillans
Posts: 536
Joined: Sat Nov 04, 2006 6:21 am
Location: Scottish Borders, UK
Contact:

Postby neillans » Wed Mar 07, 2007 10:14 am

After going through the Destination Dialog, the $TARGETDIR$ should be assigned correctly (at least, after line 159).

The additional slash in the path is actually stripped out internally, and will not cause any problems (at least, it doesnt on the XP and Vista machines I use here).

Certainly back behaviour is incorrect; line 150 should be moved down, and a check added to search and replace $TARGETDIR$ for $FIXEDDIR$, replacing it with nothing (stripping off the automatically added portion).

For example:
(As text)

Code: Select all

Replace \\$FIXEDPATH$ with  in variable TARGETDIR

(As IA Code)

Code: Select all

~InstallAware Clipboard Data~
~Replace String~
~{CCD39964-FE2C-4A4D-9EC2-87D2563DE82E}~
~TARGETDIR~
~\\$FIXEDPATH$~
~~
~TRUE~
~TRUE~


Hope this helps :)
Andy Neillans

Doron
Posts: 20
Joined: Mon Nov 27, 2006 4:36 pm
Location: USA

Keep the Install folder

Postby Doron » Thu Mar 08, 2007 11:22 am

Hi Andy,

Thanks for your reply.

Certainly back behaviour is incorrect; line 150 should be moved down, and a check added to search and replace $TARGETDIR$ for $FIXEDDIR$, replacing it with nothing (stripping off the automatically added portion).


I was not sure where it suppose to go down. But maybe you try to fix the code and place it back as zip file. I am sure in 30 seconds you will be done. :)

Thanks,

Doron

neillans
Posts: 536
Joined: Sat Nov 04, 2006 6:21 am
Location: Scottish Borders, UK
Contact:

Postby neillans » Thu Mar 08, 2007 2:41 pm

New version attached :)

- Fixes back problem - now correctly shows the path
- Also fixes double \\\\ problem. Added checks to replace double with a single.

Hope this is of use :)

File Attached:

Fixed Path Demo_2.zip
Andy Neillans

Doron
Posts: 20
Joined: Mon Nov 27, 2006 4:36 pm
Location: USA

Loosing the Install folder

Postby Doron » Sun Mar 11, 2007 7:30 pm

Hi Andy,

It is still does not work the way I was hoping it will. :D
After debugging the code the crux of the problem is actually found in the PROGRAMFILES which is causing in my case to lose the installation folder.

I don’t need to see the folder named Program Files and that is part of the problem. All works fine if the target install folder is like C:\\ProgramFiles\\ABC and if the user change the target folder in the destination dialog to E:\\MySub\\ABC it works fine.

To rectify the above I tried to the below:
Get Folder Location Special->Boot Path into PROGRAMFILE

Now it partially resolved the problem and I see under the destination folder C:\\ABC which is great. But assigning the Boot path creates another problem. When I select a different folder like E:\\Dev or Just E:\\ then it removes the Install folder name, which looks to me something fundamental the way InstallAware works. So this way the end result is still E:\\Dev Instead of E:\\Dev\\ABC as it supposes to be.

I also enter the following in the Target Folder under Project Properties: $PROGRAMFILES$\\ABC so this way initially based on your code the user sees it as: c:\\Program Files\\ABC. Also made a slight modification in line 85 as follows:
Set Variable FIXEDDIR to ABC

The user needs to see the change instantly while the Destination Dialog is on and the Replace code does not change that in that dialog. So the end result is that I am back to square one. The way I describe the above was a feature that I used for many years in Wise and was easily implemented.

Thanks,

Doron

neillans
Posts: 536
Joined: Sat Nov 04, 2006 6:21 am
Location: Scottish Borders, UK
Contact:

Postby neillans » Tue Mar 13, 2007 2:58 pm

Hi Doron,

Not sure I understand.

The default path is indeed Program Files \\ Fixed Dir.

If you change the installation folder path (via the destination dialog) this replaces the Programs Files portion of the path, but keeps the Fixed Dir.

i.e you set D:\\Programs the final path would be D:\\Programs\\Fixed Dir.

I don't think you want to be used Boot Path; this might give you unpredictable results on some configurations (unless you always want to default the installation to be on the root of the drive that the operating system is on?) -- if this is the case, I should warn you that this is not the "Microsoft" way and you will encounter problems on some operating systems (specifically Vista and Longhorn, but also on XP if its been "secured").

If you do want to default to the Windows system root drive, certainly using Boot Path will do what you want. However, you should instead replace line 84 (Set Variable TARGETDIR to $PROGRAMFILES$
) with

Code: Select all

Set Variable TARGETDIR
Get Folder Location Special->Boot Path into TARGETDIR
Andy Neillans


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 132 guests