hi!

is ther any ideas, how can i change in msi start in for the shortcut?
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

1
It's defined by the WkDir column of the shortcut table...

http://msdn.microsoft.com/en-us/library/aa371847(VS.85).aspx

Cheers,
Rob.
Answered 09/18/2009 by: MSIPackager
Third Degree Black Belt

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 mean that i need to create property [WkDir]=L:\%USERPROFILE%
and it will create write start in?
Answered 09/18/2009 by: lanselots
Fourth Degree Brown Belt

Please log in to comment
0
It's defined by the WkDir column of the shortcut table

:)

BTW, the %USERPROFILE% environment variable will already have a drive letter prefixing it, won't it?
Answered 09/18/2009 by: VBScab
Red Belt

Please log in to comment
0
lol - now that's what I call subtle
Answered 09/18/2009 by: MSIPackager
Third Degree Black Belt

Please log in to comment
0
anyway it is not working, I even create property and pot in workdir, but launcing installation i get error 2704, i understand that there is something wrong with property or dir wich i change, but i dont know what, please help
Answered 09/20/2009 by: lanselots
Fourth Degree Brown Belt

Please log in to comment
0
If you validate your package, it should highlight the offending entry in the Directory table.

IIRC, you're a Wise Package Studio user? If you look at the Directory table in the 'Tables' view, it should be highlighted in red.
Answered 09/21/2009 by: VBScab
Red Belt

Please log in to comment
0
ok, i have made that in start in shows username and different drive(I crate property with %USERNAME%), but when i login with another user acount, i cheked, that username didn change, and left my, please help
Answered 09/21/2009 by: lanselots
Fourth Degree Brown Belt

Please log in to comment
0
Sounds like a basic Wise Package Studio / Application Packaging course might be a good place to start. There's loads of information on the internet and this forum.
Try googling: wise shortcut working directory
You'll get lots of results.
Answered 10/02/2009 by: JillBA
Senior Yellow Belt

Please log in to comment
0
Good day everyone.

I feel a bit odd reviving such an old thread, but still I did a search :). First time ever I was unable to find a solution.
I have the same problem and it hasn't been resolved yet.

Quick recap:
I need to set Working Directory in a Shortcut during install to point to %APPDATA%\Logs for any given user.
Problem is (and i found it the hard way through trial and error) "The references are resolved to an actual path when the installer resolves the working directory to create the shortcut."
So when the installation is done under any user accout, "Start In" field is populated with that user's appdata folder for every other user.

I'm using ORCA and I guess this could be somehow achieved with populating CustomAction table, but i've been into Windows Installer Database editing for like couple of hours or so, and my knowledge is less than basic. Any direction (and i mean step-by-step guide :D) would be kindly appreciated.

Thanks in advance!
Answered 05/25/2011 by: Curry
Senior Yellow Belt

Please log in to comment
0
Have you checked in usermode after self healing of application?

In user mode after the first self heal the start in folder path is getting changed to that USERPROFILE.

But when you get back to administrator again, it will show the path of that user where it has been last selfhealed.

If you are using this application for different users of the same pc then this is a problem because it will show the path of the user in which it has been last self healed.

I am not sure if you can get this done by using custom action, but ypu can use active setup to create the shortcut.
Answered 05/25/2011 by: naveen.packager
Green Belt

Please log in to comment
3
have you tried running the command
msiexec.exe /fs {productcode} /qb (or /qn)
through an activesetup for each user?

As a test you could run it manually for a target user and see if the shortcut gets rewritten like you want it to.

EDIT: Since it's gonna have to run every time, maybe the RUN key in HKLM would be a better place for the command's trigger.

PJ
Answered 05/25/2011 by: pjgeutjens
Red Belt

Please log in to comment
0
ORIGINAL: pjgeutjens

have you tried running the command
msiexec.exe /fs {productcode} /qb (or /qn)
through an activesetup for each user?

As a test you could run it manually for a target user and see if the shortcut gets rewritten like you want it to.

EDIT: Since it's gonna have to run every time, maybe the RUN key in HKLM would be a better place for the command's trigger.

PJ


This works!!! The shortcuts gets repaired to point to the desired working dir.
Answered 05/25/2011 by: an33th
Orange Belt

Please log in to comment
0
PJ,

Your command works.

But i observed one problem here in admin mode(or if any user have administrator rights). In admin mode even after running that command(or even after manually reparing from msi) the path wont change, it will be the path of the user last accessed and it will use that file.

If you delete the admin appdata file, it wont self heal.This may be because it is having permission to access the key file from user.

Just out of curiosity iam posting this. May be this will be a problem in these type of scenarios.
Answered 05/25/2011 by: naveen.packager
Green Belt

Please log in to comment
0
Yeah... Thank kinda works, but still doesn't seem right...

Here's what i did:

1. Create new vbs script Shortcut.vbs.

'Replace the following:
'<Your directory> - specify your directory with any number of parent directories
'Thanks to: http://www.appdeploy.com/messageboards/fb.asp?m=28595
'<Shortcut name> - obvious
'<Path to .exe> - path to .exe file you are making a shortcut to.
'Example: %PROGRAMFILES%\Internet Explorer\iexplore.exe
'<Path to icon> - example: %PROGRAMFILES%\Internet Explorer\iexplore.exe, 0

'Creating a folder first.
Dim WSHShell : Set WSHShell = CreateObject("WScript.Shell")
Dim sAPPDATA : sAPPDATA = WSHShell.Environment("Volatile").Item ("APPDATA")
Dim Path : Path = sAPPDATA & "\<Your directory>"

Call Recursion(Path)

Function Recursion(DirectoryPath)
Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject")

If FSO.FolderExists(DirectoryPath) Then Exit Function
Call Recursion(FSO.GetParentFolderName(DirectoryPath))
FSO.CreateFolder(DirectoryPath)
End Function

'Now for the Shortcut itself
set WshShell = CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("AllUsersDesktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\<Shortcut name>.lnk")
oShellLink.TargetPath = "<Path to .exe>"
oShellLink.IconLocation = "<Path to icon>"
oShellLink.WorkingDirectory = "%APPDATA%\<Your directory>"
oShellLink.Save

2. Open up you MSI project in ORCA and go to Binary table. Add Row:

    Name: AddShortcut
    Data: <Full path to vbs script>\Shortcut.vbs

3. Go to CustomAction table. Add Row:

    Action: RunAddShortcut
    Type: 6
    Source: AddShortcut
    Target: <leave blank>

(Type 6 stands for VBScript)
4. Go to InstallExecuteSequence table. Add Row:

    Action: RunAddShortcut
    Condition: NOT Installed
    Sequence: 6500

5. Go to Shortcut table and remove unneeded rows.

Still one problem remains. Working Directory folder and shortcut are not removed on uninstall. This doesn't bother me at all but might be an issue for someone.
Answered 05/27/2011 by: Curry
Senior Yellow Belt

Please log in to comment
0
Still one problem remains. Working Directory folder and shortcut are not removed on uninstall.

Again you can use a vbscript for this on uninstall.
Answered 05/27/2011 by: naveen.packager
Green Belt

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