Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MSI file - Question

237 views
Skip to first unread message

Tom Rahav

unread,
Mar 13, 2006, 2:44:38 AM3/13/06
to
Hi,

I use visual basic .net 2005. I have a win-form project that I want to
distribute to customers. I've created a setup project that installs my
application, creates its directories, etc.
My problem is that every time when the customer double-clicks the
application's icon on his desktop, the application "installs" itself (the
.msi file runs and installs files) and sometimes asks to reboot the system.
I think it happens because I change (create, delete and modify) files in the
application's directories during runtime.
How can I avoid this behavior? Can I configure the MSI file not to look for
changes in the application's directory?
If so, how? If not, how can I create an installation file that doesn't do
that?

Thanks!
Tom.


Gary Chang[MSFT]

unread,
Mar 13, 2006, 6:12:13 AM3/13/06
to
Hi Tom,

>How can I avoid this behavior? Can I configure the MSI file
>not to look for changes in the application's directory?

Such a behavior is as expected of an application which installed by a
VS2005 setup project. The VS2005 setup project will create an
installation-on-demand shortcut by default.

To disable the generation of the installation-on-demand shortcut, you need
to modify the target package's(.msi file) directly---add the property
DISABLEADVTSHORTCUTS (case sensitive) to itse Property table with the value
of 1. You can do this via the MSI SDK utility Orca or use the following
vbscript with the command DisableAdvt yourPackage.msi

'DisableAdvt.vbs file code:

Option Explicit

Const msiOpenDatabaseModeTransact = 1
Dim argNum, argCount:argCount = Wscript.Arguments.Count


Dim openMode : openMode = msiOpenDatabaseModeTransact

' Connect to Windows installer object
On Error Resume Next
Dim installer : Set installer = Nothing
Set installer = Wscript.CreateObject("WindowsInstaller.Installer") :
CheckError

' Open database
Dim databasePath:databasePath = Wscript.Arguments(0)
Dim database : Set database = installer.OpenDatabase(databasePath,
openMode) : CheckError

' Process SQL statements
Dim query, view, record, message, rowData, columnCount, delim, column

query = "INSERT INTO Property(Property, Value) VALUES
('DISABLEADVTSHORTCUTS ', '1')"
Set view = database.OpenView(query) : CheckError
view.Execute : CheckError

database.Commit

If Not IsEmpty(message) Then Wscript.Echo message
Wscript.Quit 0

Sub CheckError
Dim message, errRec
If Err = 0 Then Exit Sub
message = Err.Source & " " & Hex(Err) & ": " & Err.Description
If Not installer Is Nothing Then
Set errRec = installer.LastErrorRecord
If Not errRec Is Nothing Then message = message & vbLf &
errRec.FormatText
End If
Fail message
End Sub

Sub Fail(message)
Wscript.Echo message
Wscript.Quit 2
End Sub


Wish this helps!

Best regards,

Gary Chang
Microsoft Community Support
======================================================
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
======================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================

0 new messages