AgentWild
Posts: 4
Joined: Mon Jul 25, 2005 4:55 pm

Hot to set the workingfolder of shortcut to [sourcedir]?

Hi,

I would like to create a shortcut with the working folder to be the [sourcedir] (the place where the msi application is).

How do I do that?

Dave
AgentWild
Posts: 4
Joined: Mon Jul 25, 2005 4:55 pm

nothing
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

Hi Dave,

I'm afraid this is not supported in Advanced Installer yet. We will add it to the list of improvements for our product.

There is a way to manually to this, but it is very complicated. If this is imperative for your project I could tell you how to do it.

Regards,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com
srm2710
Posts: 13
Joined: Thu Feb 09, 2006 6:01 pm

shortcut point back towards directory containing setup files

This is also of importance to our use of the product to create a client-server install package. We have seperate installs for server files and client files, the latter being installed from a \setup directory.

Ideally, the shortcut should point one level 'up' (ie closer to the drive root) from the \setup subdirectory the install file has been lauched from:

<application dir>\setup\setup.exe

The 'installation path' setup dialogue during the client install is used to place resources unique to each attached user, so 'retargetting' the server .exe repeatedly is not possible.

Any comment would be grately appreciated. Thanks.
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

First, I shall describe how to create a shortcut to a file located in the same
directory as the install package (this directory is given by the "SourceDir" property):

1. In the Install Parameters page, create a new property (for example SD) and set its
default value to "C:\" (without quotes).

2. In the Files and Folders page, select from the toolbar: "New Folder -> Property
Based" and then select the "SD" item from the tree control.

3. Still in the Files and Folders page, create a New Shortcut To an External File. In
the "New Shortcut" dialog:
a) In the "Shortcut Target" text field enter: [SD]YourProgram.exe
b) Choose the desired Shortcut Folder.
c) Click the button at the right of the "Working Directory" text field and select the "SD" item from the tree control.

4. Switch to the Custom Actions page and create a New Property Set with Formatted
Custom Action scheduled on the "InstallFiles" stage. If the "InstallFiles" tree item is not visible in the tree control, use the "Show Standard Action" toolbar button and select "Before Finalization -> InstallFiles".

Make the following settings for this Custom Action:
a) Property Name : SD
b) Formatted Text: [SourceDir]

In order to set "SD" to the parent directory of "SourceDir", set the Formatted Text
to: [SourceDir]..\

Hope this helps.

Regards,
Denis
Last edited by Ionut on Fri Feb 10, 2006 4:39 pm, edited 4 times in total.
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
srm2710
Posts: 13
Joined: Thu Feb 09, 2006 6:01 pm

Thank so much for replying - great product.

I implemented your advice but the resultant shortcut points to c:\(app name.exe), as if the [sourcedir] property didn't "take".

The [sourcedir] \setup folder is not immediately the c:\ root; it is someway 'up' the d:\ drive folder structure.

In CUSTOM ACTIONS, I added the property source to "create shortcuts"(new install sequence folder) and then "install finalise" (new install sequence folder), as the option to do so on "Install" was greyed out.


stephen
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

It seems that I forgot to mention the stage in which the Property Set with Formatted Custom Action is supposed to run. My apologies - I have updated the previous post accordingly.

The only thing you need to do is to move the Custom Action to the "InstallFiles" stage (drag it to the appropriate item in the tree control).

Regards,
Denis
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
srm2710
Posts: 13
Joined: Thu Feb 09, 2006 6:01 pm

Thank you for this,

I have included your last alteration, but the resultant shortcut still targets:

C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\my.exe

If a set the shortcut to target the [SD] folder directly, I get:

C:\Documents and Settings\Administrator\Local Settings\Temp

The source Directory is d:\app_name\setup
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

The shortcut does not work if you create an EXE package which includes all the install files. This is because the MSI is extracted to a temporary location ("C:\Documents and Settings\[User]\Local Settings\Temp") and executed from there. Therefore, the working directory for the shortcut will be set to this folder, not to the one where your EXE setup resides.

The solution would be to create an EXE setup and leave install files outside (select this in the Media page), or create a package without an EXE bootstrapper (if this is possible, that is, you are not using Prerequisites).

I have added this feature to our TODO list and in a future release you will be able to use an EXE package which includes all the install files and have access to the folder where the EXE setup resides.

Regards,
Denis
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
srm2710
Posts: 13
Joined: Thu Feb 09, 2006 6:01 pm

Many thanks

Works! Many thanks for your excellent support. Great product.

Cheers

Stephen
srm2710
Posts: 13
Joined: Thu Feb 09, 2006 6:01 pm

footnote

As a footnote, this seems not to work when the install takes place on a win98 PC using the <InstMsiA.exe> etc support files.

In this event, the shortcut points to: \setup\application.exe - i.e. it does not point 'up one level'..

I assume the custom action that transforms [SourceDir]../ is not triggered.
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,
this seems not to work when the install takes place on a win98 PC using the <InstMsiA.exe> etc support files.
I have tested the package on a Win98 machine and I could not reproduce this behaviour.
I assume the custom action that transforms [SourceDir]../ is not triggered.
This could happen only if there is an Execution Condition on the "Property Set with Formatted" Custom Action that prevents it from running. Moreover, if the CA is not executed, then the Property will still hold the default value ("C:\") set in the Install Parameters page.

In order to test your package, add 2 Script Inline Custom Actions on the "InstallFiles" stage: one before and the other one after the "Property Set with Formatted" CA. These are the properties of these 2 CAs:
- Source Type: Visual basic script (*.vbs)
- Script Text:

Code: Select all

MsgBox Session.Property("PSD")
Replace "PSD" with the name of the Property you have created in the Install Parameters page (used also to create the "Property Based" folder).

Hope this helps.

Regards,
Denis
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
srm2710
Posts: 13
Joined: Thu Feb 09, 2006 6:01 pm

Resolved

Thanks for this.

Rather stupidly, at the beginning of all this, I overlooked the simple workaround of using " ..\ " in the path construction!

d:\application\setup\..\app.exe works fine (also when creating registry values).

We have now purchased the product and are very happy with it.

Suggestion: a help page clarifying the various syntax conventions in the software would be useful.

Regards

Stephen

Return to “Feature Requests”