https://www.liberkey.com/forum/
<Registry>
<RegReplace>
<RegVar>
<RegValue>HKLM\SOFTWARE\Collectorz.com\Movie\MCE</RegValue>
<StringID>Folder Path</StringID>
<Replace compare="txt">%LBK_APP_PATH%\App\AppData_ORI\Local\Collectorz.com\Movie Collector\MCE\</Replace>
</RegVar>
</RegReplace>
</Registry>
<RegSettings regfile="Data\MovieCollector.reg" level="required">
</RegSettings>
<RegReplace regfile="Data\DEF_MovieCollector.reg" level="required">
</RegReplace>
<Registry>
<RegSettings regfile="Data/settings/un fichier.reg" level="optional">
<Value>HKCU\Software\7-zip\Options\WorkDirPath</Value>
</RegSettings>
</Registry>
<RegReplace>
<RegVar>
<RegValue>HKCU\Software\7-zip\Options\WorkDirPath</RegValue>
<StringID>_LBK_APP_PATH_</StringID>
<Replace compare="txt">%LBK_APP_PATH%</Replace>
</RegVar>
</RegReplace>
<Registry>
<RegSettings regfile="Data\MovieCollector_ConfigUser.reg" level="required">
<Section>HKCU\Software\Collectorz.com\Movie</Section>
<Section>HKLM\SOFTWARE\Classes\.mvc</Section>
<Section>HKLM\SOFTWARE\Classes\Movie Collector</Section>
<Section>HKLM\SOFTWARE\Collectorz.com\Movie</Section>
</RegSettings>
<RegSettings regfile="Data\MovieCollector_ConfigDefaultPath.reg" level="required">
<Value>HKCU\Software\Collectorz.com\Movie\Databases</Value>
<Value>HKLM\SOFTWARE\Collectorz.com\Movie\MCE</Value>
</RegSettings>
<RegReplace>
<RegVar>
<RegValue>HKCU\Software\Collectorz.com\Movie\Databases</RegValue>
<StringID>CurrentDatabase</StringID>
<Replace compare="txt">%LBK_APP_PATH%\Documents\Movie Collector\Test.mvc</Replace>
</RegVar>
<RegVar>
<RegValue>HKLM\SOFTWARE\Collectorz.com\Movie\MCE</RegValue>
<StringID>XML Path</StringID>
<Replace compare="txt">%LBK_APP_PATH%\App\AppData\Local\Collectorz.com\Movie Collector\MCE\movies.mcexml</Replace>
</RegVar>
</RegReplace>
</Registry>
REGEDIT4
[HKEY_CURRENT_USER\Software\Collectorz.com\Movie\Databases]
"CurrentDatabase"="..\\..\\-- DataBase --\\MovieCollector - Films\\db-films.mvc"
[HKEY_CURRENT_USER\Software\Collectorz.com\Movie\Folders]
"Data"="..\\..\\-- DataBase --\\MovieCollector - Films\\"
"App"=""
"Backup"="..\\..\\-- DataBase --\\MovieCollector - Films\\Backup\\"
"UserTemplates"="..\\..\\-- DataBase --\\MovieCollector - Films\\Templates\\"
"UserFiles"="..\\..\\-- DataBase --\\MovieCollector - Films\\"
"MediaFiles"="..\\..\\-- DataBase --\\MovieCollector - Films\\"
[HKEY_CURRENT_USER\Software\Collectorz.com\Movie\Settings]
"ImageBaseFolder"="..\\..\\-- DataBase --\\MovieCollector - Films\\Images\\"
"ThumbnailBaseFolder"="..\\..\\-- DataBase --\\MovieCollector - Films\\Thumbnails\\"
"LookupItemImagesFolder"="..\\..\\-- DataBase --\\MovieCollector - Films\\Images\\Listitemimages\\"
[HKEY_LOCAL_MACHINE\Software\Collectorz.com\Movie\MCE]
"XML Path"="..\\DefaultData\\localappdata\\Collectorz.com\\Movie Collector\\MCE\\movies.mcexml"
REGEDIT4
[HKEY_CURRENT_USER\Software\Collectorz.com\Movie\Databases]
[HKEY_CURRENT_USER\Software\Collectorz.com\Movie\Folders]
[HKEY_CURRENT_USER\Software\Collectorz.com\Movie\Settings]
[HKEY_LOCAL_MACHINE\Software\Collectorz.com\Movie\MCE]
[HKEY_LOCAL_MACHINE\Software\Collectorz.com\Movie\MCE]
"XML Path"="..\\DefaultData\\localappdata\\Collectorz.com\\Movie Collector\\MCE\\movies.mcexml"
<RegVar>
<RegValue>HKLM\SOFTWARE\Collectorz.com\Movie\MCE</RegValue>
<StringID>XML Path</StringID>
<Replace compare="txt">%LBK_APP_PATH%\App\AppData\Local\Collectorz.com\Movie Collector\MCE\movies.mcexml</Replace>
</RegVar>
<Registry>
<RegSettings regfile="Data/settings/un fichier.reg" level="optional">
<Value>HKCU\Software\Collectorz.com\Movie\Databases\CurrentDatabase</Value>
<Value>HKCU\Software\Collectorz.com\Movie\Folders\Data</Value>
<Value>HKCU\Software\Collectorz.com\Movie\Folders\App</Value>
<Value>HKCU\Software\Collectorz.com\Movie\Folders\Backup</Value>
<Value>HKCU\Software\Collectorz.com\Movie\Folders\UserTemplates</Value>
<Value>HKCU\Software\Collectorz.com\Movie\Folders\UserFiles</Value>
<Value>HKCU\Software\Collectorz.com\Movie\Folders\MediaFiles</Value>
<Value>HKCU\Software\Collectorz.com\Movie\Settings\ImageBaseFolder</Value>
<Value>HKCU\Software\Collectorz.com\Movie\Settings\ThumbnailBaseFolder</Value>
<Value>HKCU\Software\Collectorz.com\Movie\Settings\LookupItemImagesFolder</Value>
<Value>HKLM\Software\Collectorz.com\Movie\MCE\XML Path</Value>
<SectionKill force="no">HKCU\Software\Collectorz.com\Movie</SectionKill>
<SectionKill force="no">HKLM\Software\Collectorz.com\Movie</SectionKill>
</RegSettings>
</Registry>
<RegReplace>
<RegVar>
<RegValue>HKCU\Software\Collectorz.com\Movie\Databases\CurrentDatabase</RegValue>
<StringID>_LBK_APP_PATH_</StringID>
<Replace compare="txt">%LBK_APP_PATH%</Replace>
</RegVar>
<RegVar>
<RegValue>HKCU\Software\Collectorz.com\Movie\Folders\Data</RegValue>
<StringID>_LBK_APP_PATH_</StringID>
<Replace compare="txt">%LBK_APP_PATH%</Replace>
</RegVar>
<RegVar>
<RegValue>HKCU\Software\Collectorz.com\Movie\Folders\App</RegValue>
<StringID>_LBK_APP_PATH_</StringID>
<Replace compare="txt">%LBK_APP_PATH%</Replace>
</RegVar>
<RegVar>
<RegValue>HKCU\Software\Collectorz.com\Movie\Folders\Backup</RegValue>
<StringID>_LBK_APP_PATH_</StringID>
<Replace compare="txt">%LBK_APP_PATH%</Replace>
</RegVar>
<RegVar>
<RegValue>HKCU\Software\Collectorz.com\Movie\Folders\UserTemplates</RegValue>
<StringID>_LBK_APP_PATH_</StringID>
<Replace compare="txt">%LBK_APP_PATH%</Replace>
</RegVar>
<RegVar>
<RegValue>HKCU\Software\Collectorz.com\Movie\Folders\UserFiles</RegValue>
<StringID>_LBK_APP_PATH_</StringID>
<Replace compare="txt">%LBK_APP_PATH%</Replace>
</RegVar>
<RegVar>
<RegValue>HKCU\Software\Collectorz.com\Movie\Folders\MediaFiles</RegValue>
<StringID>_LBK_APP_PATH_</StringID>
<Replace compare="txt">%LBK_APP_PATH%</Replace>
</RegVar>
<RegVar>
<RegValue>HKCU\Software\Collectorz.com\Movie\Settings\ImageBaseFolder</RegValue>
<StringID>_LBK_APP_PATH_</StringID>
<Replace compare="txt">%LBK_APP_PATH%</Replace>
</RegVar>
<RegVar>
<RegValue>HKCU\Software\Collectorz.com\Movie\Settings\ThumbnailBaseFolder</RegValue>
<StringID>_LBK_APP_PATH_</StringID>
<Replace compare="txt">%LBK_APP_PATH%</Replace>
</RegVar>
<RegVar>
<RegValue>HKCU\Software\Collectorz.com\Movie\Settings\LookupItemImagesFolder</RegValue>
<StringID>_LBK_APP_PATH_</StringID>
<Replace compare="txt">%LBK_APP_PATH%</Replace>
</RegVar>
<RegVar>
<RegValue>HKLM\Software\Collectorz.com\Movie\MCE\XML Path</RegValue>
<StringID>_LBK_APP_PATH_</StringID>
<Replace compare="txt">%LBK_APP_PATH%</Replace>
</RegVar>
</RegReplace>
<RegVar>
<RegValue>HKCU\Software\Collectorz.com\Movie\Databases\CurrentDatabase</RegValue>
<Replace create/compare="txt">%LBK_APP_PATH%</Replace>
</RegVar>
Au démarrage, le portabilizer enregistre les noms des clés qu'il doit restaurer (les <Value> dans <RegSettings>), ensuite il lance l'application (pour le moment, ne parlons pas du .reg, si mauvaises valeurs il y a dedans, ce n'est pas grave)
A la clôture de l'application, il regarde dans ces mêmes clés, s'il y a quelque part la valeur %LBK_APP_PATH% et la remplace dans le ficher .reg spécifié par _LBK_APP_PATH_ (pas toute la valeur, seulement le chemin correspondant à %LBK_APP_PATH%)
Au lancement suivant de l'appli, il ouvrira à nouveau le .reg et remplacera pour chaque clé (<RegValue> dans <RegVar>) la valeur _LBK_APP_PATH_ par %LBK_APP_PATH% (pas toute la valeur, seulement _LBK_APP_PATH_)
Atlankey a écrit:car sinon, je suis dependant du reg.
Atlankey a écrit:et en plus donc fausse toute la config du logiciel car je _LBK_APP_PATH_ et detecter du coup que au 3 démarrage du soft car il compare et met a jour le reg a la fin du 2eme lancement....