[WiX-users] cursor in invalid state

2008-12-08 Thread Scott Sam
I'm trying to get patching working for one of our products.  The problem
is that there are currently 2 more files in the latest version than were
in the original version.  This is causing the patch to fail.  I read
that the new files sequence have to be at the end of the file table. So
I'm trying to write a utility to change the sequence values
appropriately. When I try to update the view I get an error. cursor in
invalid state.

Is this the best way to solve my problem? If so why am I getting this
error?

Here is my source code.

 

public static bool ReOrderFileTable(string original, string upgrade)

{

Database originalDb = null;

Database upgradeDb = null;

View originalFileView = null;

View upgradeFileView = null;



try

{

// set dbs 

originalDb = new Database(original);

upgradeDb = new
Database(upgrade,DatabaseOpenMode.Direct);

 

// create view of file table

originalFileView = originalDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);

upgradeFileView = upgradeDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);

 

// execute view

originalFileView.Execute();

upgradeFileView.Execute();

}

catch { }

 

if ((originalFileView != null)(upgradeFileView != null))

{

if (originalFileView.Count() == upgradeFileView.Count())

{ return true; } // same amount of files so should not
need to re order

 

if (originalFileView.Count()  upgradeFileView.Count())

{ return false; } // can't remove files with a patch

 

int offset = 0;

int x=1;

Record originalRecord = null;

Record upgradeRecord = null;

int originalCount = originalFileView.Count();

int upgradeCount = upgradeFileView.Count();

while(x = originalCount + offset)

{

// get next record from view

originalRecord = originalFileView.Fetch();

upgradeRecord = upgradeFileView.Fetch();

 

// while upgrade file name != original file name
change sequence to be last and get new upgrade file

while (originalRecord[File].ToString() !=
upgradeRecord[File].ToString())

{

offset++;

upgradeRecord[Sequence] = upgradeCount +
offset;

upgradeFileView.Update(upgradeRecord);

upgradeRecord = upgradeFileView.Fetch();

}

// if there are no more original files adjust
upgrade file sequence to remove gap

if (originalRecord == null)

{

upgradeRecord[Sequence] =
(int)upgradeRecord[Sequence] - offset;

}

// if sequence is off fix upgrade sequence

if ((int)originalRecord[Sequence] !=
(int)upgradeRecord[Sequence])

{

upgradeRecord[Sequence] =
(int)originalRecord[Sequence];

}

x++;

}

// close records

originalRecord.Close();

upgradeRecord.Close();

}

upgradeDb.Commit();

 

originalDb.Close();

upgradeDb.Close();

return true;

}

}

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] cursor in invalid state

2008-12-08 Thread Rob Mensching
Why not just mark the new Files with PatchGroup and let WiX take care of 
sequencing them for you?

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 08:37
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] cursor in invalid state

I'm trying to get patching working for one of our products.  The problem
is that there are currently 2 more files in the latest version than were
in the original version.  This is causing the patch to fail.  I read
that the new files sequence have to be at the end of the file table. So
I'm trying to write a utility to change the sequence values
appropriately. When I try to update the view I get an error. cursor in
invalid state.

Is this the best way to solve my problem? If so why am I getting this
error?

Here is my source code.



public static bool ReOrderFileTable(string original, string upgrade)

{

Database originalDb = null;

Database upgradeDb = null;

View originalFileView = null;

View upgradeFileView = null;



try

{

// set dbs

originalDb = new Database(original);

upgradeDb = new
Database(upgrade,DatabaseOpenMode.Direct);



// create view of file table

originalFileView = originalDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);

upgradeFileView = upgradeDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);



// execute view

originalFileView.Execute();

upgradeFileView.Execute();

}

catch { }



if ((originalFileView != null)(upgradeFileView != null))

{

if (originalFileView.Count() == upgradeFileView.Count())

{ return true; } // same amount of files so should not
need to re order



if (originalFileView.Count()  upgradeFileView.Count())

{ return false; } // can't remove files with a patch



int offset = 0;

int x=1;

Record originalRecord = null;

Record upgradeRecord = null;

int originalCount = originalFileView.Count();

int upgradeCount = upgradeFileView.Count();

while(x = originalCount + offset)

{

// get next record from view

originalRecord = originalFileView.Fetch();

upgradeRecord = upgradeFileView.Fetch();



// while upgrade file name != original file name
change sequence to be last and get new upgrade file

while (originalRecord[File].ToString() !=
upgradeRecord[File].ToString())

{

offset++;

upgradeRecord[Sequence] = upgradeCount +
offset;

upgradeFileView.Update(upgradeRecord);

upgradeRecord = upgradeFileView.Fetch();

}

// if there are no more original files adjust
upgrade file sequence to remove gap

if (originalRecord == null)

{

upgradeRecord[Sequence] =
(int)upgradeRecord[Sequence] - offset;

}

// if sequence is off fix upgrade sequence

if ((int)originalRecord[Sequence] !=
(int)upgradeRecord[Sequence])

{

upgradeRecord[Sequence] =
(int)originalRecord[Sequence];

}

x++;

}

// close records

originalRecord.Close();

upgradeRecord.Close();

}

upgradeDb.Commit();



originalDb.Close();

upgradeDb.Close();

return true;

}

}

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https

Re: [WiX-users] cursor in invalid state

2008-12-08 Thread Scott Sam
I tried that. I set the PatchGroup to 1 for the two new files.  I still
get the same error as when I don't use the PatchGroup attribute on the
two files.  I get the file 'filename' cannot be installed because the
file cannot be found in the cabinet file.
If I remove the 2 files from the new installer before creating the patch
everything works fine. I using the Using Purely WiX method from the help
file to create the patches.

-Original Message-
From: Rob Mensching [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 08, 2008 12:44 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

Why not just mark the new Files with PatchGroup and let WiX take care of
sequencing them for you?

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 08:37
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] cursor in invalid state

I'm trying to get patching working for one of our products.  The problem
is that there are currently 2 more files in the latest version than were
in the original version.  This is causing the patch to fail.  I read
that the new files sequence have to be at the end of the file table. So
I'm trying to write a utility to change the sequence values
appropriately. When I try to update the view I get an error. cursor in
invalid state.

Is this the best way to solve my problem? If so why am I getting this
error?

Here is my source code.



public static bool ReOrderFileTable(string original, string upgrade)

{

Database originalDb = null;

Database upgradeDb = null;

View originalFileView = null;

View upgradeFileView = null;



try

{

// set dbs

originalDb = new Database(original);

upgradeDb = new
Database(upgrade,DatabaseOpenMode.Direct);



// create view of file table

originalFileView = originalDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);

upgradeFileView = upgradeDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);



// execute view

originalFileView.Execute();

upgradeFileView.Execute();

}

catch { }



if ((originalFileView != null)(upgradeFileView != null))

{

if (originalFileView.Count() == upgradeFileView.Count())

{ return true; } // same amount of files so should not
need to re order



if (originalFileView.Count()  upgradeFileView.Count())

{ return false; } // can't remove files with a patch



int offset = 0;

int x=1;

Record originalRecord = null;

Record upgradeRecord = null;

int originalCount = originalFileView.Count();

int upgradeCount = upgradeFileView.Count();

while(x = originalCount + offset)

{

// get next record from view

originalRecord = originalFileView.Fetch();

upgradeRecord = upgradeFileView.Fetch();



// while upgrade file name != original file name
change sequence to be last and get new upgrade file

while (originalRecord[File].ToString() !=
upgradeRecord[File].ToString())

{

offset++;

upgradeRecord[Sequence] = upgradeCount +
offset;

upgradeFileView.Update(upgradeRecord);

upgradeRecord = upgradeFileView.Fetch();

}

// if there are no more original files adjust
upgrade file sequence to remove gap

if (originalRecord == null)

{

upgradeRecord[Sequence] =
(int)upgradeRecord[Sequence] - offset;

}

// if sequence is off fix upgrade sequence

if ((int)originalRecord[Sequence] !=
(int)upgradeRecord[Sequence])

{

upgradeRecord[Sequence] =
(int)originalRecord[Sequence];

}

x++;

}

// close records

originalRecord.Close();

upgradeRecord.Close();

}

upgradeDb.Commit();



originalDb.Close();

upgradeDb.Close();

return true;

}

}


--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
Nevada.
The future of the web can't happen without you.  Join us at MIX09 to
help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix

Re: [WiX-users] cursor in invalid state

2008-12-08 Thread Scott Sam
Well after taking a closer look, using the patchgroup attribute does fix
the sequencing.  It doesn't not get rid of the error like I thought it
would.  Is there anything else that I can do to stop getting the file
'filename' cannot be installed because the file cannot be found in the
cabinet file. error

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 08, 2008 1:24 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

I tried that. I set the PatchGroup to 1 for the two new files.  I still
get the same error as when I don't use the PatchGroup attribute on the
two files.  I get the file 'filename' cannot be installed because the
file cannot be found in the cabinet file.
If I remove the 2 files from the new installer before creating the patch
everything works fine. I using the Using Purely WiX method from the help
file to create the patches.

-Original Message-
From: Rob Mensching [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 08, 2008 12:44 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

Why not just mark the new Files with PatchGroup and let WiX take care of
sequencing them for you?

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 08:37
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] cursor in invalid state

I'm trying to get patching working for one of our products.  The problem
is that there are currently 2 more files in the latest version than were
in the original version.  This is causing the patch to fail.  I read
that the new files sequence have to be at the end of the file table. So
I'm trying to write a utility to change the sequence values
appropriately. When I try to update the view I get an error. cursor in
invalid state.

Is this the best way to solve my problem? If so why am I getting this
error?

Here is my source code.



public static bool ReOrderFileTable(string original, string upgrade)

{

Database originalDb = null;

Database upgradeDb = null;

View originalFileView = null;

View upgradeFileView = null;



try

{

// set dbs

originalDb = new Database(original);

upgradeDb = new
Database(upgrade,DatabaseOpenMode.Direct);



// create view of file table

originalFileView = originalDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);

upgradeFileView = upgradeDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);



// execute view

originalFileView.Execute();

upgradeFileView.Execute();

}

catch { }



if ((originalFileView != null)(upgradeFileView != null))

{

if (originalFileView.Count() == upgradeFileView.Count())

{ return true; } // same amount of files so should not
need to re order



if (originalFileView.Count()  upgradeFileView.Count())

{ return false; } // can't remove files with a patch



int offset = 0;

int x=1;

Record originalRecord = null;

Record upgradeRecord = null;

int originalCount = originalFileView.Count();

int upgradeCount = upgradeFileView.Count();

while(x = originalCount + offset)

{

// get next record from view

originalRecord = originalFileView.Fetch();

upgradeRecord = upgradeFileView.Fetch();



// while upgrade file name != original file name
change sequence to be last and get new upgrade file

while (originalRecord[File].ToString() !=
upgradeRecord[File].ToString())

{

offset++;

upgradeRecord[Sequence] = upgradeCount +
offset;

upgradeFileView.Update(upgradeRecord);

upgradeRecord = upgradeFileView.Fetch();

}

// if there are no more original files adjust
upgrade file sequence to remove gap

if (originalRecord == null)

{

upgradeRecord[Sequence] =
(int)upgradeRecord[Sequence] - offset;

}

// if sequence is off fix upgrade sequence

if ((int)originalRecord[Sequence] !=
(int)upgradeRecord[Sequence])

{

upgradeRecord[Sequence] =
(int)originalRecord[Sequence];

}

x++;

}

// close records

originalRecord.Close();

upgradeRecord.Close

Re: [WiX-users] cursor in invalid state

2008-12-08 Thread Rob Mensching
Make sure the files are ending up in the right cabinets.

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 10:36
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

Well after taking a closer look, using the patchgroup attribute does fix
the sequencing.  It doesn't not get rid of the error like I thought it
would.  Is there anything else that I can do to stop getting the file
'filename' cannot be installed because the file cannot be found in the
cabinet file. error

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 1:24 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

I tried that. I set the PatchGroup to 1 for the two new files.  I still
get the same error as when I don't use the PatchGroup attribute on the
two files.  I get the file 'filename' cannot be installed because the
file cannot be found in the cabinet file.
If I remove the 2 files from the new installer before creating the patch
everything works fine. I using the Using Purely WiX method from the help
file to create the patches.

-Original Message-
From: Rob Mensching [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 12:44 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

Why not just mark the new Files with PatchGroup and let WiX take care of
sequencing them for you?

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 08:37
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] cursor in invalid state

I'm trying to get patching working for one of our products.  The problem
is that there are currently 2 more files in the latest version than were
in the original version.  This is causing the patch to fail.  I read
that the new files sequence have to be at the end of the file table. So
I'm trying to write a utility to change the sequence values
appropriately. When I try to update the view I get an error. cursor in
invalid state.

Is this the best way to solve my problem? If so why am I getting this
error?

Here is my source code.



public static bool ReOrderFileTable(string original, string upgrade)

{

Database originalDb = null;

Database upgradeDb = null;

View originalFileView = null;

View upgradeFileView = null;



try

{

// set dbs

originalDb = new Database(original);

upgradeDb = new
Database(upgrade,DatabaseOpenMode.Direct);



// create view of file table

originalFileView = originalDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);

upgradeFileView = upgradeDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);



// execute view

originalFileView.Execute();

upgradeFileView.Execute();

}

catch { }



if ((originalFileView != null)(upgradeFileView != null))

{

if (originalFileView.Count() == upgradeFileView.Count())

{ return true; } // same amount of files so should not
need to re order



if (originalFileView.Count()  upgradeFileView.Count())

{ return false; } // can't remove files with a patch



int offset = 0;

int x=1;

Record originalRecord = null;

Record upgradeRecord = null;

int originalCount = originalFileView.Count();

int upgradeCount = upgradeFileView.Count();

while(x = originalCount + offset)

{

// get next record from view

originalRecord = originalFileView.Fetch();

upgradeRecord = upgradeFileView.Fetch();



// while upgrade file name != original file name
change sequence to be last and get new upgrade file

while (originalRecord[File].ToString() !=
upgradeRecord[File].ToString())

{

offset++;

upgradeRecord[Sequence] = upgradeCount +
offset;

upgradeFileView.Update(upgradeRecord);

upgradeRecord = upgradeFileView.Fetch();

}

// if there are no more original files adjust
upgrade file sequence to remove gap

if (originalRecord == null)

{

upgradeRecord[Sequence] =
(int)upgradeRecord[Sequence] - offset;

}

// if sequence is off fix upgrade sequence

if ((int)originalRecord[Sequence] !=
(int)upgradeRecord[Sequence

Re: [WiX-users] cursor in invalid state

2008-12-08 Thread Scott Sam
How do I do this with a patch?

-Original Message-
From: Rob Mensching [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 08, 2008 2:00 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

Make sure the files are ending up in the right cabinets.

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 10:36
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

Well after taking a closer look, using the patchgroup attribute does fix
the sequencing.  It doesn't not get rid of the error like I thought it
would.  Is there anything else that I can do to stop getting the file
'filename' cannot be installed because the file cannot be found in the
cabinet file. error

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 1:24 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

I tried that. I set the PatchGroup to 1 for the two new files.  I still
get the same error as when I don't use the PatchGroup attribute on the
two files.  I get the file 'filename' cannot be installed because the
file cannot be found in the cabinet file.
If I remove the 2 files from the new installer before creating the patch
everything works fine. I using the Using Purely WiX method from the help
file to create the patches.

-Original Message-
From: Rob Mensching [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 12:44 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

Why not just mark the new Files with PatchGroup and let WiX take care of
sequencing them for you?

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 08:37
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] cursor in invalid state

I'm trying to get patching working for one of our products.  The problem
is that there are currently 2 more files in the latest version than were
in the original version.  This is causing the patch to fail.  I read
that the new files sequence have to be at the end of the file table. So
I'm trying to write a utility to change the sequence values
appropriately. When I try to update the view I get an error. cursor in
invalid state.

Is this the best way to solve my problem? If so why am I getting this
error?

Here is my source code.



public static bool ReOrderFileTable(string original, string upgrade)

{

Database originalDb = null;

Database upgradeDb = null;

View originalFileView = null;

View upgradeFileView = null;



try

{

// set dbs

originalDb = new Database(original);

upgradeDb = new
Database(upgrade,DatabaseOpenMode.Direct);



// create view of file table

originalFileView = originalDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);

upgradeFileView = upgradeDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);



// execute view

originalFileView.Execute();

upgradeFileView.Execute();

}

catch { }



if ((originalFileView != null)(upgradeFileView != null))

{

if (originalFileView.Count() == upgradeFileView.Count())

{ return true; } // same amount of files so should not
need to re order



if (originalFileView.Count()  upgradeFileView.Count())

{ return false; } // can't remove files with a patch



int offset = 0;

int x=1;

Record originalRecord = null;

Record upgradeRecord = null;

int originalCount = originalFileView.Count();

int upgradeCount = upgradeFileView.Count();

while(x = originalCount + offset)

{

// get next record from view

originalRecord = originalFileView.Fetch();

upgradeRecord = upgradeFileView.Fetch();



// while upgrade file name != original file name
change sequence to be last and get new upgrade file

while (originalRecord[File].ToString() !=
upgradeRecord[File].ToString())

{

offset++;

upgradeRecord[Sequence] = upgradeCount +
offset;

upgradeFileView.Update(upgradeRecord);

upgradeRecord = upgradeFileView.Fetch();

}

// if there are no more original files adjust
upgrade file sequence to remove gap

if (originalRecord == null

Re: [WiX-users] cursor in invalid state

2008-12-08 Thread Rob Mensching
I was suggesting looking in the base MSI files.

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 11:16
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

How do I do this with a patch?

-Original Message-
From: Rob Mensching [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 2:00 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

Make sure the files are ending up in the right cabinets.

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 10:36
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

Well after taking a closer look, using the patchgroup attribute does fix
the sequencing.  It doesn't not get rid of the error like I thought it
would.  Is there anything else that I can do to stop getting the file
'filename' cannot be installed because the file cannot be found in the
cabinet file. error

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 1:24 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

I tried that. I set the PatchGroup to 1 for the two new files.  I still
get the same error as when I don't use the PatchGroup attribute on the
two files.  I get the file 'filename' cannot be installed because the
file cannot be found in the cabinet file.
If I remove the 2 files from the new installer before creating the patch
everything works fine. I using the Using Purely WiX method from the help
file to create the patches.

-Original Message-
From: Rob Mensching [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 12:44 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

Why not just mark the new Files with PatchGroup and let WiX take care of
sequencing them for you?

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 08:37
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] cursor in invalid state

I'm trying to get patching working for one of our products.  The problem
is that there are currently 2 more files in the latest version than were
in the original version.  This is causing the patch to fail.  I read
that the new files sequence have to be at the end of the file table. So
I'm trying to write a utility to change the sequence values
appropriately. When I try to update the view I get an error. cursor in
invalid state.

Is this the best way to solve my problem? If so why am I getting this
error?

Here is my source code.



public static bool ReOrderFileTable(string original, string upgrade)

{

Database originalDb = null;

Database upgradeDb = null;

View originalFileView = null;

View upgradeFileView = null;



try

{

// set dbs

originalDb = new Database(original);

upgradeDb = new
Database(upgrade,DatabaseOpenMode.Direct);



// create view of file table

originalFileView = originalDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);

upgradeFileView = upgradeDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);



// execute view

originalFileView.Execute();

upgradeFileView.Execute();

}

catch { }



if ((originalFileView != null)(upgradeFileView != null))

{

if (originalFileView.Count() == upgradeFileView.Count())

{ return true; } // same amount of files so should not
need to re order



if (originalFileView.Count()  upgradeFileView.Count())

{ return false; } // can't remove files with a patch



int offset = 0;

int x=1;

Record originalRecord = null;

Record upgradeRecord = null;

int originalCount = originalFileView.Count();

int upgradeCount = upgradeFileView.Count();

while(x = originalCount + offset)

{

// get next record from view

originalRecord = originalFileView.Fetch();

upgradeRecord = upgradeFileView.Fetch();



// while upgrade file name != original file name
change sequence to be last and get new upgrade file

while (originalRecord[File].ToString() !=
upgradeRecord[File].ToString())

{

offset++;

upgradeRecord[Sequence] = upgradeCount +
offset;

upgradeFileView.Update(upgradeRecord

Re: [WiX-users] cursor in invalid state

2008-12-08 Thread Scott Sam
There is only one cab file in each base msi file.  all of the files are
in the cab.  Is there something else I should be looking for?

-Original Message-
From: Rob Mensching [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 08, 2008 2:33 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

I was suggesting looking in the base MSI files.

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 11:16
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

How do I do this with a patch?

-Original Message-
From: Rob Mensching [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 2:00 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

Make sure the files are ending up in the right cabinets.

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 10:36
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

Well after taking a closer look, using the patchgroup attribute does fix
the sequencing.  It doesn't not get rid of the error like I thought it
would.  Is there anything else that I can do to stop getting the file
'filename' cannot be installed because the file cannot be found in the
cabinet file. error

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 1:24 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

I tried that. I set the PatchGroup to 1 for the two new files.  I still
get the same error as when I don't use the PatchGroup attribute on the
two files.  I get the file 'filename' cannot be installed because the
file cannot be found in the cabinet file.
If I remove the 2 files from the new installer before creating the patch
everything works fine. I using the Using Purely WiX method from the help
file to create the patches.

-Original Message-
From: Rob Mensching [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 12:44 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

Why not just mark the new Files with PatchGroup and let WiX take care of
sequencing them for you?

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 08:37
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] cursor in invalid state

I'm trying to get patching working for one of our products.  The problem
is that there are currently 2 more files in the latest version than were
in the original version.  This is causing the patch to fail.  I read
that the new files sequence have to be at the end of the file table. So
I'm trying to write a utility to change the sequence values
appropriately. When I try to update the view I get an error. cursor in
invalid state.

Is this the best way to solve my problem? If so why am I getting this
error?

Here is my source code.



public static bool ReOrderFileTable(string original, string upgrade)

{

Database originalDb = null;

Database upgradeDb = null;

View originalFileView = null;

View upgradeFileView = null;



try

{

// set dbs

originalDb = new Database(original);

upgradeDb = new
Database(upgrade,DatabaseOpenMode.Direct);



// create view of file table

originalFileView = originalDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);

upgradeFileView = upgradeDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);



// execute view

originalFileView.Execute();

upgradeFileView.Execute();

}

catch { }



if ((originalFileView != null)(upgradeFileView != null))

{

if (originalFileView.Count() == upgradeFileView.Count())

{ return true; } // same amount of files so should not
need to re order



if (originalFileView.Count()  upgradeFileView.Count())

{ return false; } // can't remove files with a patch



int offset = 0;

int x=1;

Record originalRecord = null;

Record upgradeRecord = null;

int originalCount = originalFileView.Count();

int upgradeCount = upgradeFileView.Count();

while(x = originalCount + offset)

{

// get next record from view

originalRecord = originalFileView.Fetch();

upgradeRecord = upgradeFileView.Fetch();



// while upgrade file name != original file name
change sequence

Re: [WiX-users] cursor in invalid state

2008-12-08 Thread Rob Mensching
Hmm, you've hit the (very shallow) depth of my patching experience.  All I know 
is this works for many other people (using the latest tools).

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 12:49
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

There is only one cab file in each base msi file.  all of the files are
in the cab.  Is there something else I should be looking for?

-Original Message-
From: Rob Mensching [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 2:33 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

I was suggesting looking in the base MSI files.

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 11:16
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

How do I do this with a patch?

-Original Message-
From: Rob Mensching [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 2:00 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

Make sure the files are ending up in the right cabinets.

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 10:36
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

Well after taking a closer look, using the patchgroup attribute does fix
the sequencing.  It doesn't not get rid of the error like I thought it
would.  Is there anything else that I can do to stop getting the file
'filename' cannot be installed because the file cannot be found in the
cabinet file. error

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 1:24 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

I tried that. I set the PatchGroup to 1 for the two new files.  I still
get the same error as when I don't use the PatchGroup attribute on the
two files.  I get the file 'filename' cannot be installed because the
file cannot be found in the cabinet file.
If I remove the 2 files from the new installer before creating the patch
everything works fine. I using the Using Purely WiX method from the help
file to create the patches.

-Original Message-
From: Rob Mensching [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 12:44 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] cursor in invalid state

Why not just mark the new Files with PatchGroup and let WiX take care of
sequencing them for you?

-Original Message-
From: Scott Sam [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 08:37
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] cursor in invalid state

I'm trying to get patching working for one of our products.  The problem
is that there are currently 2 more files in the latest version than were
in the original version.  This is causing the patch to fail.  I read
that the new files sequence have to be at the end of the file table. So
I'm trying to write a utility to change the sequence values
appropriately. When I try to update the view I get an error. cursor in
invalid state.

Is this the best way to solve my problem? If so why am I getting this
error?

Here is my source code.



public static bool ReOrderFileTable(string original, string upgrade)

{

Database originalDb = null;

Database upgradeDb = null;

View originalFileView = null;

View upgradeFileView = null;



try

{

// set dbs

originalDb = new Database(original);

upgradeDb = new
Database(upgrade,DatabaseOpenMode.Direct);



// create view of file table

originalFileView = originalDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);

upgradeFileView = upgradeDb.OpenView(SELECT * FROM
`File` ORDER BY `Sequence`);



// execute view

originalFileView.Execute();

upgradeFileView.Execute();

}

catch { }



if ((originalFileView != null)(upgradeFileView != null))

{

if (originalFileView.Count() == upgradeFileView.Count())

{ return true; } // same amount of files so should not
need to re order



if (originalFileView.Count()  upgradeFileView.Count())

{ return false; } // can't remove files with a patch



int offset = 0;

int x=1;

Record originalRecord = null;

Record upgradeRecord = null;

int originalCount = originalFileView.Count();

int upgradeCount