Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

[C# 2.0] Déploiement: lancer appli à la fin de l'instal

7 réponses
Avatar
Frenchy
Bonjour,

J'ai une application, et le setup qui va avec (projet setup).


Je voudrais simplement lancer l'application installée à la fin de
l'instalation.

Pour celà j'ai essayé ceci:
custom action >> install, click droit >> add custom action >> Primary
output (de mon projet).

Dans les propriétés de mon primary output, si je met InstallerClass = false.

Alors il se lance, mais il se lance avant la fin de l'installation, le
programme crash car tous les fichiers n'ont pas encre été copié.

De tout facon, je souhaiterais que mon programme se lance une fois le setup
terminé, donc lors du click sur "Terminer"...

Si je fais pareil avec le commit, il me lance mon application au même
endroit (vers la fin du setup, mais jsute avant la copie des fichiers).

Donc je voudrais savoir comment lancer le programme installé en fin de setup.

Merci pour votre aide.

7 réponses

Avatar
Olivier Guinart [MS]
Bonjour,

visitez la FAQ ici :
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID!9564&SiteID=1 et
notamment la question :
Q: How do I automatically run my program after installation?
A: There is a way that might work, but it also might not work the way you
expect.
1. Create a .vbs file with the following code.
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run """" & Property("CustomActionData") & """",7,False
Set WshShell = Nothing
2. Open your setup project and go to the Custom Actions Editor
3. Select the Commit Node and right-click, add a new Custom Action
4. Browse the filesystem to add the .vbs file from step 1
5. Edit the CustomActionData property and add the following:
[TARGETDIR]YourApp.exe
6. Change “YourApp.exe” to whatever your startup app file name is.

Olivier Guinart


-Please do not send email directly to this alias. This alias is for
newsgroup purposes only
-This posting is provided “AS IS” with no warranties, and confers no rights.


--
-Please do not send email directly to this alias. This alias is for
newsgroup purposes only
-This posting is provided “AS IS” with no warranties, and confers no rights


"Frenchy" wrote:

Bonjour,

J'ai une application, et le setup qui va avec (projet setup).


Je voudrais simplement lancer l'application installée à la fin de
l'instalation.

Pour celà j'ai essayé ceci:
custom action >> install, click droit >> add custom action >> Primary
output (de mon projet).

Dans les propriétés de mon primary output, si je met InstallerClass = false.

Alors il se lance, mais il se lance avant la fin de l'installation, le
programme crash car tous les fichiers n'ont pas encre été copié.

De tout facon, je souhaiterais que mon programme se lance une fois le setup
terminé, donc lors du click sur "Terminer"...

Si je fais pareil avec le commit, il me lance mon application au même
endroit (vers la fin du setup, mais jsute avant la copie des fichiers).

Donc je voudrais savoir comment lancer le programme installé en fin de setup.

Merci pour votre aide.


Avatar
Frenchy
"but it also might not work the way you
expect."...malheureusement pour moi.

En fait, le programme se lance bien, mais toujours au même endroit, avant la
fin du setup.

Je ne comprends pas pourquoi le commit se lance avant la fin.

Pourtant le lancement d'une application à la fin d'un setup est chose
courante...

"Olivier Guinart [MS]" a écrit :

Bonjour,

visitez la FAQ ici :
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID!9564&SiteID=1 et
notamment la question :
Q: How do I automatically run my program after installation?
A: There is a way that might work, but it also might not work the way you
expect.
1. Create a .vbs file with the following code.
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run """" & Property("CustomActionData") & """",7,False
Set WshShell = Nothing
2. Open your setup project and go to the Custom Actions Editor
3. Select the Commit Node and right-click, add a new Custom Action
4. Browse the filesystem to add the .vbs file from step 1
5. Edit the CustomActionData property and add the following:
[TARGETDIR]YourApp.exe
6. Change “YourApp.exe” to whatever your startup app file name is.

Olivier Guinart


-Please do not send email directly to this alias. This alias is for
newsgroup purposes only
-This posting is provided “AS IS” with no warranties, and confers no rights.


--
-Please do not send email directly to this alias. This alias is for
newsgroup purposes only
-This posting is provided “AS IS” with no warranties, and confers no rights


"Frenchy" wrote:

> Bonjour,
>
> J'ai une application, et le setup qui va avec (projet setup).
>
>
> Je voudrais simplement lancer l'application installée à la fin de
> l'instalation.
>
> Pour celà j'ai essayé ceci:
> custom action >> install, click droit >> add custom action >> Primary
> output (de mon projet).
>
> Dans les propriétés de mon primary output, si je met InstallerClass = false.
>
> Alors il se lance, mais il se lance avant la fin de l'installation, le
> programme crash car tous les fichiers n'ont pas encre été copié.
>
> De tout facon, je souhaiterais que mon programme se lance une fois le setup
> terminé, donc lors du click sur "Terminer"...
>
> Si je fais pareil avec le commit, il me lance mon application au même
> endroit (vers la fin du setup, mais jsute avant la copie des fichiers).
>
> Donc je voudrais savoir comment lancer le programme installé en fin de setup.
>
> Merci pour votre aide.


Avatar
Olivier Guinart [MS]
Notre histoire concernant ce scénario effectivement très commun n'est
effectivement pas top-top... :(

David Guyer m'a confirmé que Commit s'exécute immédiatement après que
l'installation est terminée, mais **avant** que l'interface disparaisse, donc
le bouton "Terminer" n'est là que pour fermer le dialogue.

Deux options proposées:
1- En ouvrant le MSI final, si vous changez dans la table "Files" le numéro
de séquence du fichier à exécuter, de façon à ce que ce soit le plus grand,
il devrait être copié en dernier (donc tous les autres fichiers sont déjà là
quand vous l'exécuter).

2- Mike Wade (VB), a le js script suivant, fourni tel quel ("as is"):

// DEBUT
// EnableLaaunchApplication.js <msi-file>
// Performs a post-build fixup of an msi to launch a specific file when the
install has completed


// Configurable values
var checkboxChecked = true; // Is the checkbox on the finished dialog
checked by default?
var checkboxText = "Launch [ProductName]"; // Text for the checkbox on the
finished dialog
var filename = "WindowsApplication7.exe"; // The name of the executable to
launch


// Constant values from Windows Installer
var msiOpenDatabaseModeTransact = 1;

var msiViewModifyInsert = 1
var msiViewModifyUpdate = 2
var msiViewModifyAssign = 3
var msiViewModifyReplace = 4
var msiViewModifyDelete = 6



if (WScript.Arguments.Length != 1)
{
WScript.StdErr.WriteLine(WScript.ScriptName + " file");
WScript.Quit(1);
}

var filespec = WScript.Arguments(0);
var installer = WScript.CreateObject("WindowsInstaller.Installer");
var database = installer.OpenDatabase(filespec, msiOpenDatabaseModeTransact);

var sql
var view
var record

try
{
var fileId = FindFileIdentifier(database, filename);
if (!fileId)
throw "Unable to find '" + filename + "' in File table";


WScript.Echo("Updating the Control table...");
// Modify the Control_Next of BannerBmp control to point to the new CheckBox
sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`,
`Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE
`Dialog_`='FinishedForm' AND `Control`='BannerBmp'";
view = database.OpenView(sql);
view.Execute();
record = view.Fetch();
record.StringData(11) = "CheckboxLaunch";
view.Modify(msiViewModifyReplace, record);
view.Close();

// Resize the BodyText and BodyTextRemove controls to be reasonable
sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`,
`Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE
`Dialog_`='FinishedForm' AND `Control`='BodyTextRemove'";
view = database.OpenView(sql);
view.Execute();
record = view.Fetch();
record.IntegerData(7) = 33;
view.Modify(msiViewModifyReplace, record);
view.Close();

sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`,
`Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE
`Dialog_`='FinishedForm' AND `Control`='BodyText'";
view = database.OpenView(sql);
view.Execute();
record = view.Fetch();
record.IntegerData(7) = 33;
view.Modify(msiViewModifyReplace, record);
view.Close();

// Insert the new CheckBox control
sql = "INSERT INTO `Control` (`Dialog_`, `Control`, `Type`, `X`, `Y`,
`Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help`)
VALUES ('FinishedForm', 'CheckboxLaunch', 'CheckBox', '18', '117', '343',
'12', '3', 'LAUNCHAPP', '{VSI_MS_Sans_Serif13.0_0_0}" + checkboxText + "',
'CloseButton', '|')";
view = database.OpenView(sql);
view.Execute();
view.Close();



WScript.Echo("Updating the ControlEvent table...");
// Modify the Order of the EndDialog event of the FinishedForm to 1
sql = "SELECT `Dialog_`, `Control_`, `Event`, `Argument`, `Condition`,
`Ordering` FROM `ControlEvent` WHERE `Dialog_`='FinishedForm' AND
`Event`='EndDialog'";
view = database.OpenView(sql);
view.Execute();
record = view.Fetch();
record.IntegerData(6) = 1;
view.Modify(msiViewModifyReplace, record);
view.Close();

// Insert the Event to launch the application
sql = "INSERT INTO `ControlEvent` (`Dialog_`, `Control_`, `Event`,
`Argument`, `Condition`, `Ordering`) VALUES ('FinishedForm', 'CloseButton',
'DoAction', 'VSDCA_Launch', 'LAUNCHAPP=1', '0')";
view = database.OpenView(sql);
view.Execute();
view.Close();



WScript.Echo("Updating the CustomAction table...");
// Insert the custom action to launch the application when finished
sql = "INSERT INTO `CustomAction` (`Action`, `Type`, `Source`, `Target`)
VALUES ('VSDCA_Launch', '210', '" + fileId + "', '')";
view = database.OpenView(sql);
view.Execute();
view.Close();



if (checkboxChecked)
{
WScript.Echo("Updating the Property table...");
// Set the default value of the CheckBox
sql = "INSERT INTO `Property` (`Property`, `Value`) VALUES ('LAUNCHAPP',
'1')";
view = database.OpenView(sql);
view.Execute();
view.Close();
}



database.Commit();
}
catch(e)
{
WScript.StdErr.WriteLine(e);
WScript.Quit(1);
}



function FindFileIdentifier(database, fileName)
{
var sql
var view
var record

// First, try to find the exact file name
sql = "SELECT `File` FROM `File` WHERE `FileName`='" + fileName + "'";
view = database.OpenView(sql);
view.Execute();
record = view.Fetch();
if (record)
{
var value = record.StringData(1);
view.Close();
return value;
}
view.Close();

// The file may be in SFN|LFN format. Look for a filename in this case next
sql = "SELECT `File`, `FileName` FROM `File`";
view = database.OpenView(sql);
view.Execute();
record = view.Fetch();
while (record)
{
if (StringEndsWith(record.StringData(2), "|" + fileName))
{
var value = record.StringData(1);
view.Close();
return value;
}

record = view.Fetch();
}
view.Close();

}

function StringEndsWith(str, value)
{
if (str.length < value.length)
return false;

return (str.indexOf(value, str.length - value.length) != -1);
}
// FIN

Un exécutable (seulement .exes) est lancé (avec une case à cocher présente
dans l'installateur). Les trois premières déclarations sont à modifier selon
vos besoins.

Olivier Guinart

--
-Please do not send email directly to this alias. This alias is for
newsgroup purposes only
-This posting is provided “AS IS” with no warranties, and confers no rights


"Frenchy" wrote:

"but it also might not work the way you
expect."...malheureusement pour moi.

En fait, le programme se lance bien, mais toujours au même endroit, avant la
fin du setup.

Je ne comprends pas pourquoi le commit se lance avant la fin.

Pourtant le lancement d'une application à la fin d'un setup est chose
courante...

"Olivier Guinart [MS]" a écrit :

> Bonjour,
>
> visitez la FAQ ici :
> http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID!9564&SiteID=1 et
> notamment la question :
> Q: How do I automatically run my program after installation?
> A: There is a way that might work, but it also might not work the way you
> expect.
> 1. Create a .vbs file with the following code.
> Set WshShell = CreateObject("WScript.Shell")
> WshShell.Run """" & Property("CustomActionData") & """",7,False
> Set WshShell = Nothing
> 2. Open your setup project and go to the Custom Actions Editor
> 3. Select the Commit Node and right-click, add a new Custom Action
> 4. Browse the filesystem to add the .vbs file from step 1
> 5. Edit the CustomActionData property and add the following:
> [TARGETDIR]YourApp.exe
> 6. Change “YourApp.exe” to whatever your startup app file name is.
>
> Olivier Guinart
>
>
> -Please do not send email directly to this alias. This alias is for
> newsgroup purposes only
> -This posting is provided “AS IS” with no warranties, and confers no rights.
>
>
> --
> -Please do not send email directly to this alias. This alias is for
> newsgroup purposes only
> -This posting is provided “AS IS” with no warranties, and confers no rights
>
>
> "Frenchy" wrote:
>
> > Bonjour,
> >
> > J'ai une application, et le setup qui va avec (projet setup).
> >
> >
> > Je voudrais simplement lancer l'application installée à la fin de
> > l'instalation.
> >
> > Pour celà j'ai essayé ceci:
> > custom action >> install, click droit >> add custom action >> Primary
> > output (de mon projet).
> >
> > Dans les propriétés de mon primary output, si je met InstallerClass = false.
> >
> > Alors il se lance, mais il se lance avant la fin de l'installation, le
> > programme crash car tous les fichiers n'ont pas encre été copié.
> >
> > De tout facon, je souhaiterais que mon programme se lance une fois le setup
> > terminé, donc lors du click sur "Terminer"...
> >
> > Si je fais pareil avec le commit, il me lance mon application au même
> > endroit (vers la fin du setup, mais jsute avant la copie des fichiers).
> >
> > Donc je voudrais savoir comment lancer le programme installé en fin de setup.
> >
> > Merci pour votre aide.


Avatar
Frenchy
Merci, je vais tenter la 1ere solution.

Par contre je ne trouve aucun outil pour directement éditer mon msi. On
parle beaucoup d'Orca sur le net. Mais impossible de le télécharger, on me
revoi de lien en lien, j'ai téléchargé un sdk dans lequel il devait se
trouver. Et pourtant il n'y est pas.

Quel est l'outil le plus simple pour éditer les tables d'un msi (j'ai aussi
lu que Orca avaient des problèmes, qu'il n'enregistrait pas bien les
modifications,...)

Merci

"Olivier Guinart [MS]" a écrit :

Notre histoire concernant ce scénario effectivement très commun n'est
effectivement pas top-top... :(

David Guyer m'a confirmé que Commit s'exécute immédiatement après que
l'installation est terminée, mais **avant** que l'interface disparaisse, donc
le bouton "Terminer" n'est là que pour fermer le dialogue.

Deux options proposées:
1- En ouvrant le MSI final, si vous changez dans la table "Files" le numéro
de séquence du fichier à exécuter, de façon à ce que ce soit le plus grand,
il devrait être copié en dernier (donc tous les autres fichiers sont déjà là
quand vous l'exécuter).

2- Mike Wade (VB), a le js script suivant, fourni tel quel ("as is"):

// DEBUT
// EnableLaaunchApplication.js <msi-file>
// Performs a post-build fixup of an msi to launch a specific file when the
install has completed


// Configurable values
var checkboxChecked = true; // Is the checkbox on the finished dialog
checked by default?
var checkboxText = "Launch [ProductName]"; // Text for the checkbox on the
finished dialog
var filename = "WindowsApplication7.exe"; // The name of the executable to
launch


// Constant values from Windows Installer
var msiOpenDatabaseModeTransact = 1;

var msiViewModifyInsert = 1
var msiViewModifyUpdate = 2
var msiViewModifyAssign = 3
var msiViewModifyReplace = 4
var msiViewModifyDelete = 6



if (WScript.Arguments.Length != 1)
{
WScript.StdErr.WriteLine(WScript.ScriptName + " file");
WScript.Quit(1);
}

var filespec = WScript.Arguments(0);
var installer = WScript.CreateObject("WindowsInstaller.Installer");
var database = installer.OpenDatabase(filespec, msiOpenDatabaseModeTransact);

var sql
var view
var record

try
{
var fileId = FindFileIdentifier(database, filename);
if (!fileId)
throw "Unable to find '" + filename + "' in File table";


WScript.Echo("Updating the Control table...");
// Modify the Control_Next of BannerBmp control to point to the new CheckBox
sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`,
`Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE
`Dialog_`='FinishedForm' AND `Control`='BannerBmp'";
view = database.OpenView(sql);
view.Execute();
record = view.Fetch();
record.StringData(11) = "CheckboxLaunch";
view.Modify(msiViewModifyReplace, record);
view.Close();

// Resize the BodyText and BodyTextRemove controls to be reasonable
sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`,
`Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE
`Dialog_`='FinishedForm' AND `Control`='BodyTextRemove'";
view = database.OpenView(sql);
view.Execute();
record = view.Fetch();
record.IntegerData(7) = 33;
view.Modify(msiViewModifyReplace, record);
view.Close();

sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`,
`Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE
`Dialog_`='FinishedForm' AND `Control`='BodyText'";
view = database.OpenView(sql);
view.Execute();
record = view.Fetch();
record.IntegerData(7) = 33;
view.Modify(msiViewModifyReplace, record);
view.Close();

// Insert the new CheckBox control
sql = "INSERT INTO `Control` (`Dialog_`, `Control`, `Type`, `X`, `Y`,
`Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help`)
VALUES ('FinishedForm', 'CheckboxLaunch', 'CheckBox', '18', '117', '343',
'12', '3', 'LAUNCHAPP', '{VSI_MS_Sans_Serif13.0_0_0}" + checkboxText + "',
'CloseButton', '|')";
view = database.OpenView(sql);
view.Execute();
view.Close();



WScript.Echo("Updating the ControlEvent table...");
// Modify the Order of the EndDialog event of the FinishedForm to 1
sql = "SELECT `Dialog_`, `Control_`, `Event`, `Argument`, `Condition`,
`Ordering` FROM `ControlEvent` WHERE `Dialog_`='FinishedForm' AND
`Event`='EndDialog'";
view = database.OpenView(sql);
view.Execute();
record = view.Fetch();
record.IntegerData(6) = 1;
view.Modify(msiViewModifyReplace, record);
view.Close();

// Insert the Event to launch the application
sql = "INSERT INTO `ControlEvent` (`Dialog_`, `Control_`, `Event`,
`Argument`, `Condition`, `Ordering`) VALUES ('FinishedForm', 'CloseButton',
'DoAction', 'VSDCA_Launch', 'LAUNCHAPP=1', '0')";
view = database.OpenView(sql);
view.Execute();
view.Close();



WScript.Echo("Updating the CustomAction table...");
// Insert the custom action to launch the application when finished
sql = "INSERT INTO `CustomAction` (`Action`, `Type`, `Source`, `Target`)
VALUES ('VSDCA_Launch', '210', '" + fileId + "', '')";
view = database.OpenView(sql);
view.Execute();
view.Close();



if (checkboxChecked)
{
WScript.Echo("Updating the Property table...");
// Set the default value of the CheckBox
sql = "INSERT INTO `Property` (`Property`, `Value`) VALUES ('LAUNCHAPP',
'1')";
view = database.OpenView(sql);
view.Execute();
view.Close();
}



database.Commit();
}
catch(e)
{
WScript.StdErr.WriteLine(e);
WScript.Quit(1);
}



function FindFileIdentifier(database, fileName)
{
var sql
var view
var record

// First, try to find the exact file name
sql = "SELECT `File` FROM `File` WHERE `FileName`='" + fileName + "'";
view = database.OpenView(sql);
view.Execute();
record = view.Fetch();
if (record)
{
var value = record.StringData(1);
view.Close();
return value;
}
view.Close();

// The file may be in SFN|LFN format. Look for a filename in this case next
sql = "SELECT `File`, `FileName` FROM `File`";
view = database.OpenView(sql);
view.Execute();
record = view.Fetch();
while (record)
{
if (StringEndsWith(record.StringData(2), "|" + fileName))
{
var value = record.StringData(1);
view.Close();
return value;
}

record = view.Fetch();
}
view.Close();

}

function StringEndsWith(str, value)
{
if (str.length < value.length)
return false;

return (str.indexOf(value, str.length - value.length) != -1);
}
// FIN

Un exécutable (seulement .exes) est lancé (avec une case à cocher présente
dans l'installateur). Les trois premières déclarations sont à modifier selon
vos besoins.

Olivier Guinart

--
-Please do not send email directly to this alias. This alias is for
newsgroup purposes only
-This posting is provided “AS IS” with no warranties, and confers no rights


"Frenchy" wrote:

> "but it also might not work the way you
> expect."...malheureusement pour moi.
>
> En fait, le programme se lance bien, mais toujours au même endroit, avant la
> fin du setup.
>
> Je ne comprends pas pourquoi le commit se lance avant la fin.
>
> Pourtant le lancement d'une application à la fin d'un setup est chose
> courante...
>
> "Olivier Guinart [MS]" a écrit :
>
> > Bonjour,
> >
> > visitez la FAQ ici :
> > http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID!9564&SiteID=1 et
> > notamment la question :
> > Q: How do I automatically run my program after installation?
> > A: There is a way that might work, but it also might not work the way you
> > expect.
> > 1. Create a .vbs file with the following code.
> > Set WshShell = CreateObject("WScript.Shell")
> > WshShell.Run """" & Property("CustomActionData") & """",7,False
> > Set WshShell = Nothing
> > 2. Open your setup project and go to the Custom Actions Editor
> > 3. Select the Commit Node and right-click, add a new Custom Action
> > 4. Browse the filesystem to add the .vbs file from step 1
> > 5. Edit the CustomActionData property and add the following:
> > [TARGETDIR]YourApp.exe
> > 6. Change “YourApp.exe” to whatever your startup app file name is.
> >
> > Olivier Guinart
> >
> >
> > -Please do not send email directly to this alias. This alias is for
> > newsgroup purposes only
> > -This posting is provided “AS IS” with no warranties, and confers no rights.
> >
> >
> > --
> > -Please do not send email directly to this alias. This alias is for
> > newsgroup purposes only
> > -This posting is provided “AS IS” with no warranties, and confers no rights
> >
> >
> > "Frenchy" wrote:
> >
> > > Bonjour,
> > >
> > > J'ai une application, et le setup qui va avec (projet setup).
> > >
> > >
> > > Je voudrais simplement lancer l'application installée à la fin de
> > > l'instalation.
> > >
> > > Pour celà j'ai essayé ceci:
> > > custom action >> install, click droit >> add custom action >> Primary
> > > output (de mon projet).
> > >
> > > Dans les propriétés de mon primary output, si je met InstallerClass = false.
> > >
> > > Alors il se lance, mais il se lance avant la fin de l'installation, le
> > > programme crash car tous les fichiers n'ont pas encre été copié.
> > >
> > > De tout facon, je souhaiterais que mon programme se lance une fois le setup
> > > terminé, donc lors du click sur "Terminer"...
> > >
> > > Si je fais pareil avec le commit, il me lance mon application au même
> > > endroit (vers la fin du setup, mais jsute avant la copie des fichiers).
> > >
> > > Donc je voudrais savoir comment lancer le programme installé en fin de setup.
> > >
> > > Merci pour votre aide.


Avatar
Olivier Guinart [MS]
Bonjour,

Orca est effectivement l'outil d'edition de MSI, disponible dans le Platform
SDK
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/platform_sdk_components_for_windows_installer_developers.asp.
Ce lien n'est pas direct helas, mais en creusant, il est la pour sur :
http://www.microsoft.com/downloads/info.aspx?naF&p=3&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId¥5b6b43-e24f-4ea3-a93e-40c0ec4f68e5&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2fa%2f5%2ff%2fa5f0d781-e201-4ab6-8c6a-9bb4efed1e1a%2fPSDK-x86.exe&oRef=http%3a%2f%2fwww.microsoft.com%2fdownloads%2fresults.aspx%3fpocId%3d%26freetext%3dplatform+SDK+installer%26DisplayLang%3den).
C'est un outil formidable a mon avis Frenchy (surtout quand couple avec la
validation du MSI). Je n'ai pas entendu parler de problemes avec Orca.

Cordialement,

Olivier Guinart [MS]
--
-Please do not send email directly to this alias. This alias is for
newsgroup purposes only
-This posting is provided “AS IS” with no warranties, and confers no rights


"Frenchy" wrote:

Merci, je vais tenter la 1ere solution.

Par contre je ne trouve aucun outil pour directement éditer mon msi. On
parle beaucoup d'Orca sur le net. Mais impossible de le télécharger, on me
revoi de lien en lien, j'ai téléchargé un sdk dans lequel il devait se
trouver. Et pourtant il n'y est pas.

Quel est l'outil le plus simple pour éditer les tables d'un msi (j'ai aussi
lu que Orca avaient des problèmes, qu'il n'enregistrait pas bien les
modifications,...)

Merci

"Olivier Guinart [MS]" a écrit :

> Notre histoire concernant ce scénario effectivement très commun n'est
> effectivement pas top-top... :(
>
> David Guyer m'a confirmé que Commit s'exécute immédiatement après que
> l'installation est terminée, mais **avant** que l'interface disparaisse, donc
> le bouton "Terminer" n'est là que pour fermer le dialogue.
>
> Deux options proposées:
> 1- En ouvrant le MSI final, si vous changez dans la table "Files" le numéro
> de séquence du fichier à exécuter, de façon à ce que ce soit le plus grand,
> il devrait être copié en dernier (donc tous les autres fichiers sont déjà là
> quand vous l'exécuter).
>
> 2- Mike Wade (VB), a le js script suivant, fourni tel quel ("as is"):
>
> // DEBUT
> // EnableLaaunchApplication.js <msi-file>
> // Performs a post-build fixup of an msi to launch a specific file when the
> install has completed
>
>
> // Configurable values
> var checkboxChecked = true; // Is the checkbox on the finished dialog
> checked by default?
> var checkboxText = "Launch [ProductName]"; // Text for the checkbox on the
> finished dialog
> var filename = "WindowsApplication7.exe"; // The name of the executable to
> launch
>
>
> // Constant values from Windows Installer
> var msiOpenDatabaseModeTransact = 1;
>
> var msiViewModifyInsert = 1
> var msiViewModifyUpdate = 2
> var msiViewModifyAssign = 3
> var msiViewModifyReplace = 4
> var msiViewModifyDelete = 6
>
>
>
> if (WScript.Arguments.Length != 1)
> {
> WScript.StdErr.WriteLine(WScript.ScriptName + " file");
> WScript.Quit(1);
> }
>
> var filespec = WScript.Arguments(0);
> var installer = WScript.CreateObject("WindowsInstaller.Installer");
> var database = installer.OpenDatabase(filespec, msiOpenDatabaseModeTransact);
>
> var sql
> var view
> var record
>
> try
> {
> var fileId = FindFileIdentifier(database, filename);
> if (!fileId)
> throw "Unable to find '" + filename + "' in File table";
>
>
> WScript.Echo("Updating the Control table...");
> // Modify the Control_Next of BannerBmp control to point to the new CheckBox
> sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`,
> `Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE
> `Dialog_`='FinishedForm' AND `Control`='BannerBmp'";
> view = database.OpenView(sql);
> view.Execute();
> record = view.Fetch();
> record.StringData(11) = "CheckboxLaunch";
> view.Modify(msiViewModifyReplace, record);
> view.Close();
>
> // Resize the BodyText and BodyTextRemove controls to be reasonable
> sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`,
> `Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE
> `Dialog_`='FinishedForm' AND `Control`='BodyTextRemove'";
> view = database.OpenView(sql);
> view.Execute();
> record = view.Fetch();
> record.IntegerData(7) = 33;
> view.Modify(msiViewModifyReplace, record);
> view.Close();
>
> sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`,
> `Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE
> `Dialog_`='FinishedForm' AND `Control`='BodyText'";
> view = database.OpenView(sql);
> view.Execute();
> record = view.Fetch();
> record.IntegerData(7) = 33;
> view.Modify(msiViewModifyReplace, record);
> view.Close();
>
> // Insert the new CheckBox control
> sql = "INSERT INTO `Control` (`Dialog_`, `Control`, `Type`, `X`, `Y`,
> `Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help`)
> VALUES ('FinishedForm', 'CheckboxLaunch', 'CheckBox', '18', '117', '343',
> '12', '3', 'LAUNCHAPP', '{VSI_MS_Sans_Serif13.0_0_0}" + checkboxText + "',
> 'CloseButton', '|')";
> view = database.OpenView(sql);
> view.Execute();
> view.Close();
>
>
>
> WScript.Echo("Updating the ControlEvent table...");
> // Modify the Order of the EndDialog event of the FinishedForm to 1
> sql = "SELECT `Dialog_`, `Control_`, `Event`, `Argument`, `Condition`,
> `Ordering` FROM `ControlEvent` WHERE `Dialog_`='FinishedForm' AND
> `Event`='EndDialog'";
> view = database.OpenView(sql);
> view.Execute();
> record = view.Fetch();
> record.IntegerData(6) = 1;
> view.Modify(msiViewModifyReplace, record);
> view.Close();
>
> // Insert the Event to launch the application
> sql = "INSERT INTO `ControlEvent` (`Dialog_`, `Control_`, `Event`,
> `Argument`, `Condition`, `Ordering`) VALUES ('FinishedForm', 'CloseButton',
> 'DoAction', 'VSDCA_Launch', 'LAUNCHAPP=1', '0')";
> view = database.OpenView(sql);
> view.Execute();
> view.Close();
>
>
>
> WScript.Echo("Updating the CustomAction table...");
> // Insert the custom action to launch the application when finished
> sql = "INSERT INTO `CustomAction` (`Action`, `Type`, `Source`, `Target`)
> VALUES ('VSDCA_Launch', '210', '" + fileId + "', '')";
> view = database.OpenView(sql);
> view.Execute();
> view.Close();
>
>
>
> if (checkboxChecked)
> {
> WScript.Echo("Updating the Property table...");
> // Set the default value of the CheckBox
> sql = "INSERT INTO `Property` (`Property`, `Value`) VALUES ('LAUNCHAPP',
> '1')";
> view = database.OpenView(sql);
> view.Execute();
> view.Close();
> }
>
>
>
> database.Commit();
> }
> catch(e)
> {
> WScript.StdErr.WriteLine(e);
> WScript.Quit(1);
> }
>
>
>
> function FindFileIdentifier(database, fileName)
> {
> var sql
> var view
> var record
>
> // First, try to find the exact file name
> sql = "SELECT `File` FROM `File` WHERE `FileName`='" + fileName + "'";
> view = database.OpenView(sql);
> view.Execute();
> record = view.Fetch();
> if (record)
> {
> var value = record.StringData(1);
> view.Close();
> return value;
> }
> view.Close();
>
> // The file may be in SFN|LFN format. Look for a filename in this case next
> sql = "SELECT `File`, `FileName` FROM `File`";
> view = database.OpenView(sql);
> view.Execute();
> record = view.Fetch();
> while (record)
> {
> if (StringEndsWith(record.StringData(2), "|" + fileName))
> {
> var value = record.StringData(1);
> view.Close();
> return value;
> }
>
> record = view.Fetch();
> }
> view.Close();
>
> }
>
> function StringEndsWith(str, value)
> {
> if (str.length < value.length)
> return false;
>
> return (str.indexOf(value, str.length - value.length) != -1);
> }
> // FIN
>
> Un exécutable (seulement .exes) est lancé (avec une case à cocher présente
> dans l'installateur). Les trois premières déclarations sont à modifier selon
> vos besoins.
>
> Olivier Guinart
>
> --
> -Please do not send email directly to this alias. This alias is for
> newsgroup purposes only
> -This posting is provided “AS IS” with no warranties, and confers no rights
>
>
> "Frenchy" wrote:
>
> > "but it also might not work the way you
> > expect."...malheureusement pour moi.
> >
> > En fait, le programme se lance bien, mais toujours au même endroit, avant la
> > fin du setup.
> >
> > Je ne comprends pas pourquoi le commit se lance avant la fin.
> >
> > Pourtant le lancement d'une application à la fin d'un setup est chose
> > courante...
> >
> > "Olivier Guinart [MS]" a écrit :
> >
> > > Bonjour,
> > >
> > > visitez la FAQ ici :
> > > http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID!9564&SiteID=1 et
> > > notamment la question :
> > > Q: How do I automatically run my program after installation?
> > > A: There is a way that might work, but it also might not work the way you
> > > expect.
> > > 1. Create a .vbs file with the following code.
> > > Set WshShell = CreateObject("WScript.Shell")
> > > WshShell.Run """" & Property("CustomActionData") & """",7,False
> > > Set WshShell = Nothing
> > > 2. Open your setup project and go to the Custom Actions Editor
> > > 3. Select the Commit Node and right-click, add a new Custom Action
> > > 4. Browse the filesystem to add the .vbs file from step 1
> > > 5. Edit the CustomActionData property and add the following:
> > > [TARGETDIR]YourApp.exe
> > > 6. Change “YourApp.exe” to whatever your startup app file name is.
> > >
> > > Olivier Guinart
> > >
> > >
> > > -Please do not send email directly to this alias. This alias is for
> > > newsgroup purposes only
> > > -This posting is provided “AS IS” with no warranties, and confers no rights.
> > >
> > >
> > > --
> > > -Please do not send email directly to this alias. This alias is for
> > > newsgroup purposes only
> > > -This posting is provided “AS IS” with no warranties, and confers no rights
> > >
> > >
> > > "Frenchy" wrote:
> > >
> > > > Bonjour,
> > > >
> > > > J'ai une application, et le setup qui va avec (projet setup).
> > > >
> > > >
> > > > Je voudrais simplement lancer l'application installée à la fin de
> > > > l'instalation.
> > > >
> > > > Pour celà j'ai essayé ceci:
> > > > custom action >> install, click droit >> add custom action >> Primary
> > > > output (de mon projet).
> > > >
> > > > Dans les propriétés de mon primary output, si je met InstallerClass = false.


Avatar
Frenchy
Merci pour le lien, j'ai testé hier. Malheureusement ca semble plus complqué
que celà.

Il faut savoir que je retient les fichier dans le setup, et que je ne met
aucune compression


J'ai testé 2 solutions;

1.
- Dans la table File, je prends le numéro de séquence maximum et j'assigne
ce numéro+1 à mon output.
- Dans la table Media, je dois mettre LastSequence au numéro de séquence
assigné à l'output.

2.
Echanger le numéro de séquence entre mon output et le fichier ayant le plus
grand numéro de séquence.


Je lance la validation et j'ai 2 warnings(j'ai égallement ces warnings si je
lance la validations sans aucunes modifs):
This action ERRCA_UIANDADVERTISED has duplicated number 1 in the table
InstallUISequence
The MsiUnpublishAssemblies action SHOULD not be present in
AdvtExecuteSequence table, since it does nothing.

Dans les 2 cas j'ai la même erreur lors de l'instlall: le fichier
_9831ZE32..... ne peut pas être installé car le fichier est introuvable dans
le fichier CAB _1D5FF..........


Voilà je ne comprends pas exacetement d'où vient le problème, l'ordre de
sequencement semble changer la place dans un cab...

En gros toute modifiactaion dans la table File fait planter le setup (alors
que la validation passe).

Any idea?...



"Olivier Guinart [MS]" a écrit :

Bonjour,

Orca est effectivement l'outil d'edition de MSI, disponible dans le Platform
SDK
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/platform_sdk_components_for_windows_installer_developers.asp.
Ce lien n'est pas direct helas, mais en creusant, il est la pour sur :
http://www.microsoft.com/downloads/info.aspx?naF&p=3&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId¥5b6b43-e24f-4ea3-a93e-40c0ec4f68e5&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2fa%2f5%2ff%2fa5f0d781-e201-4ab6-8c6a-9bb4efed1e1a%2fPSDK-x86.exe&oRef=http%3a%2f%2fwww.microsoft.com%2fdownloads%2fresults.aspx%3fpocId%3d%26freetext%3dplatform+SDK+installer%26DisplayLang%3den).
C'est un outil formidable a mon avis Frenchy (surtout quand couple avec la
validation du MSI). Je n'ai pas entendu parler de problemes avec Orca.

Cordialement,

Olivier Guinart [MS]
--
-Please do not send email directly to this alias. This alias is for
newsgroup purposes only
-This posting is provided “AS IS” with no warranties, and confers no rights


"Frenchy" wrote:

> Merci, je vais tenter la 1ere solution.
>
> Par contre je ne trouve aucun outil pour directement éditer mon msi. On
> parle beaucoup d'Orca sur le net. Mais impossible de le télécharger, on me
> revoi de lien en lien, j'ai téléchargé un sdk dans lequel il devait se
> trouver. Et pourtant il n'y est pas.
>
> Quel est l'outil le plus simple pour éditer les tables d'un msi (j'ai aussi
> lu que Orca avaient des problèmes, qu'il n'enregistrait pas bien les
> modifications,...)
>
> Merci
>
> "Olivier Guinart [MS]" a écrit :
>
> > Notre histoire concernant ce scénario effectivement très commun n'est
> > effectivement pas top-top... :(
> >
> > David Guyer m'a confirmé que Commit s'exécute immédiatement après que
> > l'installation est terminée, mais **avant** que l'interface disparaisse, donc
> > le bouton "Terminer" n'est là que pour fermer le dialogue.
> >
> > Deux options proposées:
> > 1- En ouvrant le MSI final, si vous changez dans la table "Files" le numéro
> > de séquence du fichier à exécuter, de façon à ce que ce soit le plus grand,
> > il devrait être copié en dernier (donc tous les autres fichiers sont déjà là
> > quand vous l'exécuter).
> >
> > 2- Mike Wade (VB), a le js script suivant, fourni tel quel ("as is"):
> >
> > // DEBUT
> > // EnableLaaunchApplication.js <msi-file>
> > // Performs a post-build fixup of an msi to launch a specific file when the
> > install has completed
> >
> >
> > // Configurable values
> > var checkboxChecked = true; // Is the checkbox on the finished dialog
> > checked by default?
> > var checkboxText = "Launch [ProductName]"; // Text for the checkbox on the
> > finished dialog
> > var filename = "WindowsApplication7.exe"; // The name of the executable to
> > launch
> >
> >
> > // Constant values from Windows Installer
> > var msiOpenDatabaseModeTransact = 1;
> >
> > var msiViewModifyInsert = 1
> > var msiViewModifyUpdate = 2
> > var msiViewModifyAssign = 3
> > var msiViewModifyReplace = 4
> > var msiViewModifyDelete = 6
> >
> >
> >
> > if (WScript.Arguments.Length != 1)
> > {
> > WScript.StdErr.WriteLine(WScript.ScriptName + " file");
> > WScript.Quit(1);
> > }
> >
> > var filespec = WScript.Arguments(0);
> > var installer = WScript.CreateObject("WindowsInstaller.Installer");
> > var database = installer.OpenDatabase(filespec, msiOpenDatabaseModeTransact);
> >
> > var sql
> > var view
> > var record
> >
> > try
> > {
> > var fileId = FindFileIdentifier(database, filename);
> > if (!fileId)
> > throw "Unable to find '" + filename + "' in File table";
> >
> >
> > WScript.Echo("Updating the Control table...");
> > // Modify the Control_Next of BannerBmp control to point to the new CheckBox
> > sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`,
> > `Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE
> > `Dialog_`='FinishedForm' AND `Control`='BannerBmp'";
> > view = database.OpenView(sql);
> > view.Execute();
> > record = view.Fetch();
> > record.StringData(11) = "CheckboxLaunch";
> > view.Modify(msiViewModifyReplace, record);
> > view.Close();
> >
> > // Resize the BodyText and BodyTextRemove controls to be reasonable
> > sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`,
> > `Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE
> > `Dialog_`='FinishedForm' AND `Control`='BodyTextRemove'";
> > view = database.OpenView(sql);
> > view.Execute();
> > record = view.Fetch();
> > record.IntegerData(7) = 33;
> > view.Modify(msiViewModifyReplace, record);
> > view.Close();
> >
> > sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`,
> > `Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE
> > `Dialog_`='FinishedForm' AND `Control`='BodyText'";
> > view = database.OpenView(sql);
> > view.Execute();
> > record = view.Fetch();
> > record.IntegerData(7) = 33;
> > view.Modify(msiViewModifyReplace, record);
> > view.Close();
> >
> > // Insert the new CheckBox control
> > sql = "INSERT INTO `Control` (`Dialog_`, `Control`, `Type`, `X`, `Y`,
> > `Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help`)
> > VALUES ('FinishedForm', 'CheckboxLaunch', 'CheckBox', '18', '117', '343',
> > '12', '3', 'LAUNCHAPP', '{VSI_MS_Sans_Serif13.0_0_0}" + checkboxText + "',
> > 'CloseButton', '|')";
> > view = database.OpenView(sql);
> > view.Execute();
> > view.Close();
> >
> >
> >
> > WScript.Echo("Updating the ControlEvent table...");
> > // Modify the Order of the EndDialog event of the FinishedForm to 1
> > sql = "SELECT `Dialog_`, `Control_`, `Event`, `Argument`, `Condition`,
> > `Ordering` FROM `ControlEvent` WHERE `Dialog_`='FinishedForm' AND
> > `Event`='EndDialog'";
> > view = database.OpenView(sql);
> > view.Execute();
> > record = view.Fetch();
> > record.IntegerData(6) = 1;
> > view.Modify(msiViewModifyReplace, record);
> > view.Close();
> >
> > // Insert the Event to launch the application
> > sql = "INSERT INTO `ControlEvent` (`Dialog_`, `Control_`, `Event`,
> > `Argument`, `Condition`, `Ordering`) VALUES ('FinishedForm', 'CloseButton',
> > 'DoAction', 'VSDCA_Launch', 'LAUNCHAPP=1', '0')";
> > view = database.OpenView(sql);
> > view.Execute();
> > view.Close();
> >
> >
> >
> > WScript.Echo("Updating the CustomAction table...");
> > // Insert the custom action to launch the application when finished
> > sql = "INSERT INTO `CustomAction` (`Action`, `Type`, `Source`, `Target`)
> > VALUES ('VSDCA_Launch', '210', '" + fileId + "', '')";
> > view = database.OpenView(sql);
> > view.Execute();
> > view.Close();
> >
> >
> >
> > if (checkboxChecked)
> > {
> > WScript.Echo("Updating the Property table...");
> > // Set the default value of the CheckBox
> > sql = "INSERT INTO `Property` (`Property`, `Value`) VALUES ('LAUNCHAPP',
> > '1')";
> > view = database.OpenView(sql);
> > view.Execute();
> > view.Close();
> > }
> >
> >
> >
> > database.Commit();
> > }
> > catch(e)
> > {
> > WScript.StdErr.WriteLine(e);
> > WScript.Quit(1);
> > }
> >
> >
> >
> > function FindFileIdentifier(database, fileName)
> > {
> > var sql
> > var view
> > var record
> >
> > // First, try to find the exact file name
> > sql = "SELECT `File` FROM `File` WHERE `FileName`='" + fileName + "'";
> > view = database.OpenView(sql);
> > view.Execute();
> > record = view.Fetch();
> > if (record)
> > {
> > var value = record.StringData(1);
> > view.Close();
> > return value;
> > }
> > view.Close();
> >
> > // The file may be in SFN|LFN format. Look for a filename in this case next
> > sql = "SELECT `File`, `FileName` FROM `File`";
> > view = database.OpenView(sql);
> > view.Execute();
> > record = view.Fetch();
> > while (record)
> > {
> > if (StringEndsWith(record.StringData(2), "|" + fileName))
> > {
> > var value = record.StringData(1);
> > view.Close();
> > return value;
> > }
> >
> > record = view.Fetch();
> > }
> > view.Close();
> >
> > }
> >
> > function StringEndsWith(str, value)
> > {
> > if (str.length < value.length)
> > return false;
> >
> > return (str.indexOf(value, str.length - value.length) != -1);
> > }
> > // FIN
> >
> > Un exécutable (seulement .exes) est lancé (avec une case à cocher présente
> > dans l'installateur). Les trois premières déclarations sont à modifier selon
> > vos besoins.
> >
> > Olivier Guinart
> >
> > --
> > -Please do not send email directly to this alias. This alias is for
> > newsgroup purposes only
> > -This posting is provided “AS IS” with no warranties, and confers no rights
> >
> >
> > "Frenchy" wrote:
> >
> > > "but it also might not work the way you
> > > expect."...malheureusement pour moi.
> > >
> > > En fait, le programme se lance bien, mais toujours au même endroit, avant la
> > > fin du setup.
> > >
> > > Je ne comprends pas pourquoi le commit se lance avant la fin.
> > >
> > > Pourtant le lancement d'une application à la fin d'un setup est chose
> > > courante...
> > >
> > > "Olivier Guinart [MS]" a écrit :
> > >
> > > > Bonjour,
> > > >
> > > > visitez la FAQ ici :
> > > > http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID!9564&SiteID=1 et
> > > > notamment la question :
> > > > Q: How do I automatically run my program after installation?
> > > > A: There is a way that might work, but it also might not work the way you
> > > > expect.
> > > > 1. Create a .vbs file with the following code.
> > > > Set WshShell = CreateObject("WScript.Shell")
> > > > WshShell.Run """" & Property("CustomActionData") & """",7,False
> > > > Set WshShell = Nothing
> > > > 2. Open your setup project and go to the Custom Actions Editor
> > > > 3. Select the Commit Node and right-click, add a new Custom Action
> > > > 4. Browse the filesystem to add the .vbs file from step 1
> > > > 5. Edit the CustomActionData property and add the following:
> > > > [TARGETDIR]YourApp.exe
> > > > 6. Change “YourApp.exe” to whatever your startup app file name is.
> > > >
> > > > Olivier Guinart
> > > >
> > > >
> > > > -Please do not send email directly to this alias. This alias is for
> > > > newsgroup purposes only
> > > > -This posting is provided “AS IS” with no warranties, and confers no rights.
> > > >
> > > >


Avatar
Olivier Guinart [MS]
J'ai eu le meme probleme, en n'essayant que #2. Pas les warnings, mais le
fait que mais le message d'erreur "The file 'XYZ' cannot be installed because
the file cannot be found in cabinet file 'ABC'. This could indicate a network
error, an error reading from the CD-ROM, or a problem with this package.".

Par contre, en echangeant les GUIDs des 2 fichiers que j'avais intervertis,
dans la table Files (colonnes File et Component, etc...) et la table
Components (le componentID), mon installation a marche, avec mon numero de
sequence preservee.

C'est pas mal de copier-coller helas. Si ca ne marche toujours pas, ou si ca
vous parait plus complique que la solution de Mike Wade, essayez cette
derniere.

Cordialement,

Olivier Guinart [MS]
--
-Please do not send email directly to this alias. This alias is for
newsgroup purposes only
-This posting is provided “AS IS” with no warranties, and confers no rights


"Frenchy" wrote:

Merci pour le lien, j'ai testé hier. Malheureusement ca semble plus complqué
que celà.

Il faut savoir que je retient les fichier dans le setup, et que je ne met
aucune compression


J'ai testé 2 solutions;

1.
- Dans la table File, je prends le numéro de séquence maximum et j'assigne
ce numéro+1 à mon output.
- Dans la table Media, je dois mettre LastSequence au numéro de séquence
assigné à l'output.

2.
Echanger le numéro de séquence entre mon output et le fichier ayant le plus
grand numéro de séquence.


Je lance la validation et j'ai 2 warnings(j'ai égallement ces warnings si je
lance la validations sans aucunes modifs):
This action ERRCA_UIANDADVERTISED has duplicated number 1 in the table
InstallUISequence
The MsiUnpublishAssemblies action SHOULD not be present in
AdvtExecuteSequence table, since it does nothing.

Dans les 2 cas j'ai la même erreur lors de l'instlall: le fichier
_9831ZE32..... ne peut pas être installé car le fichier est introuvable dans
le fichier CAB _1D5FF..........


Voilà je ne comprends pas exacetement d'où vient le problème, l'ordre de
sequencement semble changer la place dans un cab...

En gros toute modifiactaion dans la table File fait planter le setup (alors
que la validation passe).

Any idea?...



"Olivier Guinart [MS]" a écrit :

> Bonjour,
>
> Orca est effectivement l'outil d'edition de MSI, disponible dans le Platform
> SDK
> (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/platform_sdk_components_for_windows_installer_developers.asp.
> Ce lien n'est pas direct helas, mais en creusant, il est la pour sur :
> http://www.microsoft.com/downloads/info.aspx?naF&p=3&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId¥5b6b43-e24f-4ea3-a93e-40c0ec4f68e5&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2fa%2f5%2ff%2fa5f0d781-e201-4ab6-8c6a-9bb4efed1e1a%2fPSDK-x86.exe&oRef=http%3a%2f%2fwww.microsoft.com%2fdownloads%2fresults.aspx%3fpocId%3d%26freetext%3dplatform+SDK+installer%26DisplayLang%3den).
> C'est un outil formidable a mon avis Frenchy (surtout quand couple avec la
> validation du MSI). Je n'ai pas entendu parler de problemes avec Orca.
>
> Cordialement,
>
> Olivier Guinart [MS]
> --
> -Please do not send email directly to this alias. This alias is for
> newsgroup purposes only
> -This posting is provided “AS IS” with no warranties, and confers no rights
>
>
> "Frenchy" wrote:
>
> > Merci, je vais tenter la 1ere solution.
> >
> > Par contre je ne trouve aucun outil pour directement éditer mon msi. On
> > parle beaucoup d'Orca sur le net. Mais impossible de le télécharger, on me
> > revoi de lien en lien, j'ai téléchargé un sdk dans lequel il devait se
> > trouver. Et pourtant il n'y est pas.
> >
> > Quel est l'outil le plus simple pour éditer les tables d'un msi (j'ai aussi
> > lu que Orca avaient des problèmes, qu'il n'enregistrait pas bien les
> > modifications,...)
> >
> > Merci
> >
> > "Olivier Guinart [MS]" a écrit :
> >
> > > Notre histoire concernant ce scénario effectivement très commun n'est
> > > effectivement pas top-top... :(
> > >
> > > David Guyer m'a confirmé que Commit s'exécute immédiatement après que
> > > l'installation est terminée, mais **avant** que l'interface disparaisse, donc
> > > le bouton "Terminer" n'est là que pour fermer le dialogue.
> > >
> > > Deux options proposées:
> > > 1- En ouvrant le MSI final, si vous changez dans la table "Files" le numéro
> > > de séquence du fichier à exécuter, de façon à ce que ce soit le plus grand,
> > > il devrait être copié en dernier (donc tous les autres fichiers sont déjà là
> > > quand vous l'exécuter).
> > >
> > > 2- Mike Wade (VB), a le js script suivant, fourni tel quel ("as is"):
> > >
> > > // DEBUT
> > > // EnableLaaunchApplication.js <msi-file>
> > > // Performs a post-build fixup of an msi to launch a specific file when the
> > > install has completed
> > >
> > >
> > > // Configurable values
> > > var checkboxChecked = true; // Is the checkbox on the finished dialog
> > > checked by default?
> > > var checkboxText = "Launch [ProductName]"; // Text for the checkbox on the
> > > finished dialog
> > > var filename = "WindowsApplication7.exe"; // The name of the executable to
> > > launch
> > >
> > >
> > > // Constant values from Windows Installer
> > > var msiOpenDatabaseModeTransact = 1;
> > >
> > > var msiViewModifyInsert = 1
> > > var msiViewModifyUpdate = 2
> > > var msiViewModifyAssign = 3
> > > var msiViewModifyReplace = 4
> > > var msiViewModifyDelete = 6
> > >
> > >
> > >
> > > if (WScript.Arguments.Length != 1)
> > > {
> > > WScript.StdErr.WriteLine(WScript.ScriptName + " file");
> > > WScript.Quit(1);
> > > }
> > >
> > > var filespec = WScript.Arguments(0);
> > > var installer = WScript.CreateObject("WindowsInstaller.Installer");
> > > var database = installer.OpenDatabase(filespec, msiOpenDatabaseModeTransact);
> > >
> > > var sql
> > > var view
> > > var record
> > >
> > > try
> > > {
> > > var fileId = FindFileIdentifier(database, filename);
> > > if (!fileId)
> > > throw "Unable to find '" + filename + "' in File table";
> > >
> > >
> > > WScript.Echo("Updating the Control table...");
> > > // Modify the Control_Next of BannerBmp control to point to the new CheckBox
> > > sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`,
> > > `Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE
> > > `Dialog_`='FinishedForm' AND `Control`='BannerBmp'";
> > > view = database.OpenView(sql);
> > > view.Execute();
> > > record = view.Fetch();
> > > record.StringData(11) = "CheckboxLaunch";
> > > view.Modify(msiViewModifyReplace, record);
> > > view.Close();
> > >
> > > // Resize the BodyText and BodyTextRemove controls to be reasonable
> > > sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`,
> > > `Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE
> > > `Dialog_`='FinishedForm' AND `Control`='BodyTextRemove'";
> > > view = database.OpenView(sql);
> > > view.Execute();
> > > record = view.Fetch();
> > > record.IntegerData(7) = 33;
> > > view.Modify(msiViewModifyReplace, record);
> > > view.Close();
> > >
> > > sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`,
> > > `Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE
> > > `Dialog_`='FinishedForm' AND `Control`='BodyText'";
> > > view = database.OpenView(sql);
> > > view.Execute();
> > > record = view.Fetch();
> > > record.IntegerData(7) = 33;
> > > view.Modify(msiViewModifyReplace, record);
> > > view.Close();
> > >
> > > // Insert the new CheckBox control
> > > sql = "INSERT INTO `Control` (`Dialog_`, `Control`, `Type`, `X`, `Y`,
> > > `Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help`)
> > > VALUES ('FinishedForm', 'CheckboxLaunch', 'CheckBox', '18', '117', '343',
> > > '12', '3', 'LAUNCHAPP', '{VSI_MS_Sans_Serif13.0_0_0}" + checkboxText + "',
> > > 'CloseButton', '|')";
> > > view = database.OpenView(sql);
> > > view.Execute();
> > > view.Close();
> > >
> > >
> > >
> > > WScript.Echo("Updating the ControlEvent table...");
> > > // Modify the Order of the EndDialog event of the FinishedForm to 1
> > > sql = "SELECT `Dialog_`, `Control_`, `Event`, `Argument`, `Condition`,
> > > `Ordering` FROM `ControlEvent` WHERE `Dialog_`='FinishedForm' AND
> > > `Event`='EndDialog'";
> > > view = database.OpenView(sql);
> > > view.Execute();
> > > record = view.Fetch();
> > > record.IntegerData(6) = 1;
> > > view.Modify(msiViewModifyReplace, record);
> > > view.Close();
> > >
> > > // Insert the Event to launch the application
> > > sql = "INSERT INTO `ControlEvent` (`Dialog_`, `Control_`, `Event`,
> > > `Argument`, `Condition`, `Ordering`) VALUES ('FinishedForm', 'CloseButton',
> > > 'DoAction', 'VSDCA_Launch', 'LAUNCHAPP=1', '0')";
> > > view = database.OpenView(sql);
> > > view.Execute();
> > > view.Close();
> > >
> > >
> > >
> > > WScript.Echo("Updating the CustomAction table...");
> > > // Insert the custom action to launch the application when finished
> > > sql = "INSERT INTO `CustomAction` (`Action`, `Type`, `Source`, `Target`)
> > > VALUES ('VSDCA_Launch', '210', '" + fileId + "', '')";
> > > view = database.OpenView(sql);
> > > view.Execute();
> > > view.Close();
> > >
> > >
> > >
> > > if (checkboxChecked)
> > > {
> > > WScript.Echo("Updating the Property table...");
> > > // Set the default value of the CheckBox
> > > sql = "INSERT INTO `Property` (`Property`, `Value`) VALUES ('LAUNCHAPP',
> > > '1')";
> > > view = database.OpenView(sql);
> > > view.Execute();
> > > view.Close();
> > > }
> > >
> > >
> > >
> > > database.Commit();
> > > }
> > > catch(e)
> > > {
> > > WScript.StdErr.WriteLine(e);
> > > WScript.Quit(1);
> > > }
> > >
> > >
> > >
> > > function FindFileIdentifier(database, fileName)
> > > {
> > > var sql
> > > var view
> > > var record
> > >
> > > // First, try to find the exact file name
> > > sql = "SELECT `File` FROM `File` WHERE `FileName`='" + fileName + "'";
> > > view = database.OpenView(sql);
> > > view.Execute();
> > > record = view.Fetch();
> > > if (record)
> > > {
> > > var value = record.StringData(1);
> > > view.Close();
> > > return value;
> > > }
> > > view.Close();
> > >
> > > // The file may be in SFN|LFN format. Look for a filename in this case next
> > > sql = "SELECT `File`, `FileName` FROM `File`";
> > > view = database.OpenView(sql);
> > > view.Execute();
> > > record = view.Fetch();
> > > while (record)
> > > {
> > > if (StringEndsWith(record.StringData(2), "|" + fileName))
> > > {
> > > var value = record.StringData(1);
> > > view.Close();
> > > return value;
> > > }
> > >
> > > record = view.Fetch();
> > > }
> > > view.Close();
> > >
> > > }
> > >
> > > function StringEndsWith(str, value)
> > > {
> > > if (str.length < value.length)
> > > return false;
> > >
> > > return (str.indexOf(value, str.length - value.length) != -1);
> > > }
> > > // FIN
> > >
> > > Un exécutable (seulement .exes) est lancé (avec une case à cocher présente
> > > dans l'installateur). Les trois premières déclarations sont à modifier selon
> > > vos besoins.
> > >
> > > Olivier Guinart
> > >
> > > --
> > > -Please do not send email directly to this alias. This alias is for
> > > newsgroup purposes only
> > > -This posting is provided “AS IS” with no warranties, and confers no rights