mirror of
https://github.com/LorenzCK/OnTopReplica.git
synced 2024-05-20 20:33:06 +12:00
Fixed PostInstaller application.
Added PostInstaller step to installation script. Settings folder is now removed by the uninstaller.
This commit is contained in:
parent
8aa867f41b
commit
e1dc6e45c5
|
@ -8,7 +8,11 @@ using System.Threading.Tasks;
|
||||||
namespace PostInstaller {
|
namespace PostInstaller {
|
||||||
class Program {
|
class Program {
|
||||||
static int Main(string[] args) {
|
static int Main(string[] args) {
|
||||||
return Run(args) ? 0 : 1;
|
var success = Run(args);
|
||||||
|
|
||||||
|
Console.Read();
|
||||||
|
|
||||||
|
return success ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool Run(string[] args) {
|
private static bool Run(string[] args) {
|
||||||
|
@ -40,22 +44,37 @@ namespace PostInstaller {
|
||||||
|
|
||||||
Console.WriteLine("AppUserModel.ID value: {0} (type {1})", oldValue, oldValue.GetType().AssemblyQualifiedName);
|
Console.WriteLine("AppUserModel.ID value: {0} (type {1})", oldValue, oldValue.GetType().AssemblyQualifiedName);
|
||||||
}
|
}
|
||||||
catch (Exception) {
|
catch (Exception ex) {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
throw;
|
throw;
|
||||||
|
#else
|
||||||
|
Console.WriteLine("Unable to get value of AppUserModel.ID property.");
|
||||||
|
Console.WriteLine(ex);
|
||||||
#endif
|
#endif
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Console.WriteLine("Attempting to set property 'System.AppUserModel.ID' to {0}...", args[1]);
|
try {
|
||||||
|
Console.WriteLine("Attempting to set property 'System.AppUserModel.ID' to {0}...", args[1]);
|
||||||
propStore.SetValue(ref appUserModelKey, new BStrWrapper(args[1]));
|
|
||||||
propStore.Commit();
|
|
||||||
|
|
||||||
//Store
|
propStore.SetValue(ref appUserModelKey, new BStrWrapper(args[1]));
|
||||||
((IPersistFile)link).Save(args[0], false);
|
propStore.Commit();
|
||||||
|
|
||||||
|
//Store
|
||||||
|
((IPersistFile)link).Save(args[0], false);
|
||||||
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
#if DEBUG
|
||||||
|
throw;
|
||||||
|
#else
|
||||||
|
Console.WriteLine("Unable to set value of AppUserModel.ID property.");
|
||||||
|
Console.WriteLine(ex);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
Console.WriteLine("Done.");
|
Console.WriteLine("Done.");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,6 +82,10 @@ Function RegisterApplication
|
||||||
CreateDirectory "${START_LINK_DIR}"
|
CreateDirectory "${START_LINK_DIR}"
|
||||||
CreateShortCut "${START_LINK_RUN}" "$INSTDIR\OnTopReplica.exe"
|
CreateShortCut "${START_LINK_RUN}" "$INSTDIR\OnTopReplica.exe"
|
||||||
CreateShortCut "${START_LINK_UNINSTALLER}" "$INSTDIR\${UNINSTALLER_NAME}"
|
CreateShortCut "${START_LINK_UNINSTALLER}" "$INSTDIR\${UNINSTALLER_NAME}"
|
||||||
|
|
||||||
|
;Fix link with AppID
|
||||||
|
ExecWait '"$INSTDIR\PostInstaller.exe" "${START_LINK_RUN}" "LorenzCunoKlopfenstein.OnTopReplica.MainForm"' $0
|
||||||
|
DetailPrint "Post installation shortcut fix (returned $0)."
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function un.DeregisterApplication
|
Function un.DeregisterApplication
|
||||||
|
@ -112,6 +116,10 @@ Section "!OnTopReplica" OnTopReplica
|
||||||
File "..\OnTopReplica\bin\Release\CREDITS.txt"
|
File "..\OnTopReplica\bin\Release\CREDITS.txt"
|
||||||
File "..\OnTopReplica\bin\Release\LICENSE.txt"
|
File "..\OnTopReplica\bin\Release\LICENSE.txt"
|
||||||
|
|
||||||
|
;Post installer
|
||||||
|
File "PostInstaller\PostInstaller\bin\Release\PostInstaller.exe"
|
||||||
|
File "PostInstaller\PostInstaller\bin\Release\PostInstaller.exe.config"
|
||||||
|
|
||||||
;Install localization files
|
;Install localization files
|
||||||
SetOutPath "$INSTDIR\it"
|
SetOutPath "$INSTDIR\it"
|
||||||
File "..\OnTopReplica\bin\Release\it\OnTopReplica.resources.dll"
|
File "..\OnTopReplica\bin\Release\it\OnTopReplica.resources.dll"
|
||||||
|
@ -135,6 +143,9 @@ Section "Uninstall"
|
||||||
;Remove whole directory (no data is stored there anyway)
|
;Remove whole directory (no data is stored there anyway)
|
||||||
RMDir /r "$INSTDIR"
|
RMDir /r "$INSTDIR"
|
||||||
|
|
||||||
|
;Remove roaming AppData folder (settings and logs)
|
||||||
|
RMDir /r "$APPDATA\OnTopReplica"
|
||||||
|
|
||||||
;Remove uninstaller
|
;Remove uninstaller
|
||||||
Call un.DeregisterApplication
|
Call un.DeregisterApplication
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
Loading…
Reference in a new issue